-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
utils.processoutput: reorder asyncio tasks #5480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utils.processoutput: reorder asyncio tasks #5480
Conversation
Try to drain the stdout/stderr streams first before handling the onexit task, so the overall result can be processed correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will mark this as approved since the solution seems to make sense to me based on the tests but let's see if the issue reporter can confirm this resolves their problem.
I can confirm it works now: --ffmpeg-no-validation is not needed anymore. |
Try to drain the stdout/stderr streams first before handling the onexit task, so the overall result can be processed correctly
Fixes #5461
The issue is caused by
process.wait()
resolving first in theonexit
task, so the result of thedone
future gets set without the async interator(s) of the stdout/stderr stream(s) being drained in theonoutput
task(s) first.In my eyes, this looks like an issue in asyncio's subprocess implementation... No idea if this actually fixes #5461, but reordering the tasks at least made the added test pass while not reordering them made it fail.