imageio / imageio-ffmpeg

FFMPEG wrapper for Python
BSD 2-Clause "Simplified" License
237 stars 52 forks source link

Buffers not released on program shutdown #69

Closed almarklein closed 2 years ago

almarklein commented 2 years ago

With the new release, we're getting errors in our CI workflow: https://github.com/pygfx/pygfx/pull/287#issuecomment-1098793780

In one test, we try to run an example that uses imageio-ffmpeg in a subprocess, and that subprocess fails with:

Fatal Python error: _enter_buffered_busy: could not acquire lock for <_io.BufferedReader name=8> at interpreter shutdown, possibly due to daemon threads
E         Python runtime state: finalizing (tstate=0x5630592e3240)
E         
E         Current thread 0x00007f4ca6d0f740 (most recent call first):
E           File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/imageio_ffmpeg/_io.py", line 365 in read_frames
E           File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/imageio/plugins/ffmpeg.py", line 375 in _close
E           File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/imageio/core/format.py", line 352 in close
E           File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/imageio/core/format.py", line 341 in __del__
almarklein commented 2 years ago

I can reproduce this issue locally, and have written a test that currently fails with this error.

I can also confirm that this is due to the addition of p.stderr.close() in #61.

flybird-lb commented 2 years ago

please don't send it to me

------------------ 原始邮件 ------------------ 发件人: "imageio/imageio-ffmpeg" @.>; 发送时间: 2022年4月14日(星期四) 晚上7:50 @.>; @.***>; 主题: Re: [imageio/imageio-ffmpeg] Buffers not released on program shutdown (Issue #69)

I can reproduce this issue locally, and have written a test that currently fails with this error.

I can also confirm that this is due to the addition of p.stderr.close() in #61.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

almarklein commented 2 years ago

please don't send it to me

I think you're receiving this because you've subscribed to updates from this repository.