riotkit-org / riotkit-do

RKD - RiotKit DO. Task executor - balance between Makefile and Gradle. Written in Python. Powerful tool for every DevOps. Automates production tasks as well as local development tasks
Apache License 2.0
10 stars 2 forks source link

Fatal Python error: could not acquire lock for <_io.BufferedWriter name='<stdout>'> at interpreter shutdown, possibly due to daemon threads #52

Open blackandred opened 3 years ago

blackandred commented 3 years ago

Issue:

Fatal Python error: could not acquire lock for <_io.BufferedWriter name='<stdout>'> at interpreter shutdown, possibly due to daemon threads
Python runtime state: finalizing (tstate=0x55d43b084750)

Thread 0x00007f3bf2d71640 (most recent call first):
  File "/usr/lib/python3.8/site-packages/rkd/api/inputoutput.py", line 542 in write
  File "/usr/lib/python3.8/site-packages/rkd/api/inputoutput.py", line 53 in write
  File "/usr/lib/python3.8/site-packages/rkd/process.py", line 63 in push_output
  File "/usr/lib/python3.8/threading.py", line 870 in run
  File "/usr/lib/python3.8/threading.py", line 932 in _bootstrap_inner
  File "/usr/lib/python3.8/threading.py", line 890 in _bootstrap

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

Possible solution: https://stackoverflow.com/a/45323799

blackandred commented 3 years ago

This issue needs more investigation and a better reproducible case. There is only one hint - when command in subprocess exits quickly with a negative exit code and a lot of output already printed.