`TimingListener` may not be thread-safe
Author: ikrommydCreated Apr 23, 2026Updated Sep 17, 2026
Labelsthreadingbug - incorrect behaviorfree-threading
I have gotten this failure when I was running the https://github.com/scikit-hep/numba-stats test suite to check python3.14t compatibility now that numba has 3.14t wheels with pytest-run-parallel that I cannot simply reproduce. I would like to mention it here to be investigated further by the maintainers.
==================================================================================================== ERRORS =====================================================================================================
__________________________________________________________________________________________ ERROR at call of test_njit ___________________________________________________________________________________________
def test_njit():
@nb.njit
def test(x):
a = lognorm.logpdf(x, 1.0, 0.0, 1.0)
b = lognorm.pdf(x, 1.0, 0.0, 1.0)
c = lognorm.cdf(x, 1.0, 0.0, 1.0)
d = lognorm.ppf(c, 1.0, 0.0, 1.0)
return a, b, c, d
x = np.linspace(0, 3, 10)
> a, b, c, d = test(x)
^^^^^^^
tests/test_lognorm.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/dispatcher.py:443: in _compile_for_args
raise e
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/dispatcher.py:376: in _compile_for_args
return_val = self.compile(tuple(argtypes))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/dispatcher.py:908: in compile
cres = self._compiler.compile(args, return_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/dispatcher.py:80: in compile
status, retval = self._compile_cached(args, return_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/dispatcher.py:94: in _compile_cached
retval = self._compile_core(args, return_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/dispatcher.py:107: in _compile_core
cres = compiler.compile_extra(self.targetdescr.typing_context,
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/compiler.py:739: in compile_extra
return pipeline.compile_extra(func)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/compiler.py:439: in compile_extra
return self._compile_bytecode()
^^^^^^^^^^^^^^^^^^^^^^^^
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/compiler.py:505: in _compile_bytecode
return self._compile_core()
^^^^^^^^^^^^^^^^^^^^
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/compiler.py:481: in _compile_core
raise e
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/compiler.py:473: in _compile_core
pm.run(self.state)
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/compiler_machinery.py:363: in run
raise e
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/compiler_machinery.py:356: in run
self._runPass(idx, pass_inst, state)
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/compiler_lock.py:34: in _acquire_compile_lock
with self:
^^^^
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/compiler_lock.py:23: in __exit__
self.release()
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/compiler_lock.py:17: in release
ev.end_event("numba:compiler_lock")
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/event.py:419: in end_event
broadcast(evt)
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/event.py:217: in broadcast
listener.notify(event)
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/event.py:253: in notify
self.on_end(event)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <numba.core.event.TimingListener object at 0x57d4bbf1bd0>, event = Event(numba:compiler_lock, EventStatus.END, data: None)
def on_end(self, event):
self._depth -= 1
if self._depth == 0:
last = getattr(self, "_duration", 0)
> self._duration = (timer() - self._ts) + last
^^^^^^^^
E AttributeError: 'TimingListener' object has no attribute '_ts'
../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/numba/core/event.py:274: AttributeError
=============================================================================================== warnings summary ================================================================================================
src/numba_stats/bernstein.py:183
/Users/iason/Dropbox/work/pyhep_dev/numba-stats/src/numba_stats/bernstein.py:183: FutureWarning: bernstein.scaled_pdf is deprecated and will be removed in a future release, use bernstein.density instead
warnings.warn(
src/numba_stats/bernstein.py:183
/Users/iason/Dropbox/work/pyhep_dev/numba-stats/src/numba_stats/bernstein.py:183: FutureWarning: bernstein.scaled_cdf is deprecated and will be removed in a future release, use bernstein.integral instead
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
****************************************************************************************** pytest-run-parallel report *******************************************************************************************
All tests were run in parallel!
============================================================================================ short test summary info ============================================================================================
SKIPPED [20] ../../../../micromamba/envs/py3.14t/lib/python3.14t/site-packages/pytest_run_parallel/plugin.py:120: could not import 'pydocstyle': No module named 'pydocstyle'
PARALLEL FAILED tests/test_lognorm.py::test_njit - AttributeError: 'TimingListener' object has no attribute '_ts'
================================================================ 553 passed, 20 skipped, 2 deselected, 2 warnings, 1 error in 125.06s (0:02:05) =================================================================Source: numba/numba