askap-vast / vast-tools

A collection of tools that are useful for the VAST project and for exploration of results from the VAST Pipeline.
https://vast-survey.org/vast-tools/
MIT License
8 stars 0 forks source link

Huge traceback errors when running find_sources in python 3.9.17 #502

Open ddobie opened 1 year ago

ddobie commented 1 year ago

When using find_sources in python 3.9.17 there are huge errors of the form of

Traceback (most recent call last):
OSError: handle is closed
  File "/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/site-packages/multiprocessing_logging.py", line 78, in _receive
    if self._is_closed and self.queue.empty():
  File "/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/multiprocessing/queues.py", line 129, in empty
    return not self._poll()
  File "/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/multiprocessing/connection.py", line 255, in poll
    self._check_closed()
  File "/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/multiprocessing/connection.py", line 136, in _check_closed
    raise OSError("handle is closed")
Traceback (most recent call last):
OSError: handle is closed
  File "/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/site-packages/multiprocessing_logging.py", line 78, in _receive
    if self._is_closed and self.queue.empty():
  File "/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/multiprocessing/queues.py", line 129, in empty
    return not self._poll()
  File "/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/multiprocessing/connection.py", line 255, in poll
    self._check_closed()
Traceback (most recent call last):
  File "/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/multiprocessing/connection.py", line 136, in _check_closed
    raise OSError("handle is closed")
  File "/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/site-packages/multiprocessing_logging.py", line 78, in _receive
    if self._is_closed and self.queue.empty():
  File "/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/multiprocessing/queues.py", line 129, in empty
    return not self._poll()
OSError: handle is closed
  File "/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/multiprocessing/connection.py", line 255, in poll
    self._check_closed()
  File "/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/multiprocessing/connection.py", line 136, in _check_closed
    raise OSError("handle is closed")
Fatal Python error: _enter_buffered_busy: could not acquire lock for <_io.BufferedWriter name='<stderr>'> at interpreter shutdown, possibly due to daemon threads
Python runtime state: finalizing (tstate=0x563f9d53c130)

Current thread 0x00007f504e3fa740 (most recent call first):
<no Python frame>
Aborted (core dumped)

whenever the script exits, regardless of whether that is due to an error or simply reaching the end of the script. I can't post the full traceback because it's so long, but the above is the gist of it.

The problem seems to be related to multiprocessing, but happens even when running with scheduler=single-threaded