PyAV icon indicating copy to clipboard operation
PyAV copied to clipboard

Enable or disable logging

Open eerimoq opened this issue 1 year ago • 6 comments

The current log callback sometimes deadlocks when I use aiortc with this line commented out, which uses this package. I couldn't figure out how to properly fix it, so I implemented a workaround that allows the user to totally enable and disable FFmpeg logging.

eerimoq avatar Jun 18 '23 08:06 eerimoq

I'm not sure this is an actual fix, it adds more complexity to the logging situation with yet another flag. Have you considered any alternatives?

jlaine avatar Oct 27 '23 06:10 jlaine

I don't think I did. Feel free to just close this PR as it was mostly meant to pitch the idea.

eerimoq avatar Oct 27 '23 06:10 eerimoq

To be clear, as mentioned in #1186 I think we absolutely do need to revisit the logging framework. Unless someone finds a way to fix the deadlocks introduced by logging calling back into Python I'd be in favour of ripping it out, or at least having it off by default.

.. so let's keep the PR Alive as a starting point!

jlaine avatar Oct 28 '23 16:10 jlaine

It seems to be deadlocking due to the GIL.

are you in a heavy multi-threading environment?

Could you provide some reproducing code that deadlocks even 10% of the time?

I would like to explore solutions where a C++ queue is made, and flused upon request maybe....

hmaarrfk avatar Nov 03 '23 22:11 hmaarrfk

Sorry, this was such a long time ago I barely remember what I did.

eerimoq avatar Nov 04 '23 06:11 eerimoq

understood. lets leave this open as an acknowledgement of the issue.

For future contributors, to start taking action on this front, it would be great to have some code that could reproduce even 10% of the time.

When submitting the reproducer, try too include information about the processor used in the system and the number of threads it supports.

hmaarrfk avatar Nov 04 '23 13:11 hmaarrfk

Superseded by #1383

WyattBlue avatar Apr 24 '24 21:04 WyattBlue