Project

General

Profile

Actions

Bug #870

closed

Python agent hang on teardown

Added by Christian Babeux about 10 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Target version:
Start date:
12/12/2014
Due date:
% Done:

0%

Estimated time:

Description

The UST Python agent seems to be hanging when executing this serie of commands:

test.py
#!/usr/bin/python

import logging
import lttng_agent
agent = lttng_agent.LTTngAgent()
ev1 = logging.getLogger("python-ev-test1");
ev1.debug("allo")

lttng create; lttng enable-event -p -a; lttng start then launch test.py.

A proper way to teardown the agent without calling destroy need to be found.

Actions #1

Updated by Christian Babeux about 10 years ago

  • Target version set to 2.7
Actions #2

Updated by Mathieu Desnoyers over 9 years ago

  • Status changed from New to Feedback
  • Assignee set to Mathieu Desnoyers

Should be fixed by this UST commit:

commit de4dee04fa3e008fe1044538f78778a867563aa4
Author: Philippe Proulx <eeppeliteloop@gmail.com>
Date:   Tue Mar 31 20:09:54 2015 -0400

    Refactor Python agent

    This patch refactors the whole LTTng-UST Python agent.
    Notorious changes are:

      * Python module "lttng_agent" moved to Python package
        "lttngust". This removes "agent" from the name, which
        really is an implementation detail. "lttngust" is used
        because "lttng" would clash with LTTng-tools Python
        bindings.
      * Python package instead of simple module. Splitting the
        code in various modules will make future development
        easier.
      * Use daemon threads to make sure logging with tracing
        support is available as long as the regular threads live,
        while making sure that the application exits instantly when
        its regular threads die.
      * Create client threads and register to session daemons
        at import time. This allows the package to be usable just
        by importing it (no need to instanciate any specific class
        or call any specific function).
      * Do not use a semaphore + sleep to synchronize client threads
        with the importing thread: use a blocking synchronized
        queue with appropriate timeouts.
      * Add debug statements at strategic locations, enabled by
        setting the $LTTNG_UST_PYTHON_DEBUG environment variable
        to 1 before importing the package.
      * Override the default session daemon registration timeout
        with $LTTNG_UST_PYTHON_REGISTER_TIMEOUT (ms).
      * Override the default session daemon registration retry
        delay with $LTTNG_UST_PYTHON_REGISTER_RETRY_DELAY (ms).
      * Honor $LTTNG_HOME (to retrieve session daemon TCP ports).
      * Do not use an absolute path when loading the tracepoint
        provider shared object. Users should use the
        $LD_LIBRARY_PATH environment variable to override the
        default library path when running Python instead.
      * Do not keep an event dictionary since this brings issues
        when enabling/disabling events with the same name in
        different sessions.
      * Make sure the reference count does not go below 0,
        which could happen when destroying a session which contains
        events that are disabled already.
      * Minor improvements to make the code more Pythonic.

    Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Actions #3

Updated by Mathieu Desnoyers over 9 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF