Skip to content

Fix racy import from worker threads

vlorentz requested to merge import-shell into master
Traceback (most recent call last):
  File "/home/vlorentz/.local/lib/python3.9/site-packages/luigi/worker.py", line 203, in run
    new_deps = self._run_get_new_deps()
  File "/home/vlorentz/.local/lib/python3.9/site-packages/luigi/worker.py", line 138, in _run_get_new_deps
    task_gen = self.task.run()
  File "/home/vlorentz/swh-graph/swh/graph/luigi/compressed_graph.py", line 1338, in run
    for i, relative_path in tqdm.tqdm(
  File "/home/vlorentz/.local/lib/python3.9/site-packages/tqdm/std.py", line 1178, in __iter__
    for obj in iterable:
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 870, in next
    raise value
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/vlorentz/swh-graph/swh/graph/luigi/compressed_graph.py", line 1358, in _upload_file
    from ..shell import Command
ImportError: cannot import name 'Command' from partially initialized module 'swh.graph.shell' (most likely due to a circular import) (/home/vlorentz/swh-graph/swh/graph/shell.py)

Merge request reports