Fix: python lttngust agent fails when LTTNG_UST_APP_PATH is not set
authorKienan Stewart <kstewart@efficios.com>
Fri, 9 Feb 2024 19:18:59 +0000 (14:18 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 19 Feb 2024 14:22:59 +0000 (09:22 -0500)
commit2dbe84f739b26671faf2b2a15a91e5edb132bf1a
tree557a57d79cdb07d434e62bceca786d8628b10b98
parent3287f48be61ef3491aff0a80b7185ac57b3d8a5d
Fix: python lttngust agent fails when LTTNG_UST_APP_PATH is not set

Observed issue
==============

lttng-tools `tests/regression/ust/python-logging/test_python_logging`
had the following failures:

```
not ok 14 - Found 0 / 5 events matching 'python-ev-test1' amongst 0 events
not ok 27 - Found 0 / 5 events matching 'python-ev-test1' amongst 0 events
not ok 40 - Found 0 / 5 events matching 'python-ev-test1' amongst 0 events
not ok 53 - Found 0 / 5 events matching 'python-ev-test1' out of 0 events
not ok 66 - Found 0 / 1 events matching 'python-ev-test2' amongst 0 events
not ok 74 - Found 0 / 1 events matching 'python-ev-test2' amongst 0 events
not ok 82 - Found 0 / 5 events matching 'python-ev-test1' amongst 0 events
not ok 98 - Found 0 / 1 events matching 'python-ev-test2' amongst 0 events
not ok 109 - Found 0 / 5 events matching 'python-ev-test1' out of 0 events
not ok 115 - Found 0 events matching 'python-ev-test1'
not ok 121 - Found 0 / 1 events matching 'python-ev-test2' amongst 0 events
not ok 127 - Found 0 / 5 events matching 'python-ev-test1' amongst 0 events
not ok 134 - Found 0 / 10 events matching 'python-ev-test1' amongst 0 events
not ok 140 - Found 0 / 5 events matching 'python-ev-test1' amongst 0 events
not ok 146 - Found 0 / 5 events matching 'python-ev-test1' amongst 0 events
not ok 157 - Found 0 / 5 events matching 'python-ev-test1' amongst 0 events
```

Cause
=====

When the use of `LTTNG_UST_APP_PATH` was introduced[1], no default
value for `ust_app_port` was set. In the case where
`LTTNG_UST_APP_PATH` is not set in the environment the condition for
starting with the `ust_app_port` is still checked, causing the
following exception:

```
[2559145.907503] LTTng-UST warning: _init_threads(): cannot create client threads: cannot access local variable 'ust_app_port' where it is not associated with a value
```

Solution
========

Provide a known default value for `ust_app_port`.

Known drawbacks
===============

None.

References
==========

[1]: https://github.com/lttng/lttng-ust/commit/c0f6fb054d2f16518d047a6adf7e8aa81eff5403

Change-Id: I92242ccd056dd91505156e4e8df812639eaef570
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/python-lttngust/lttngust/agent.py
This page took 0.024923 seconds and 4 git commands to generate.