fix: prevent Zoom SDK shutdown segfaults - #981
Open
solaoi wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CleanUPSDK()Problem
A native Zoom bot process can complete its work successfully and then fail during Python interpreter shutdown. Zoom SDK service, callback, raw-data helper, or renderer wrappers may remain alive after
CleanUPSDK(), causing nanobind finalization to segfault.This change releases SDK-owned resources in dependency order. The
run_botcommand also flushes logging and standard streams before exiting the dedicated bot process without running the unsafe finalization path. This only happens afterrun_bot.run()returns normally and only whenzoom_meeting_sdkwas loaded; exceptions still propagate normally.There are no API or user-facing behavior changes.
Testing
python manage.py test bots.tests.test_zoom_bot.TestZoomSDKShutdown --verbosity 2python manage.py test bots.tests.test_zoom_bot.TestZoomBot.test_bot_can_wait_for_host_then_join_meeting bots.tests.test_zoom_bot.TestZoomBot.test_bot_can_join_meeting_and_record_audio_and_video --keepdbruff checkon all changed Python filesruff format --checkon all changed Python filesThe shutdown regression test starts the real
zoom-meeting-sdkin a child process, obtains a raw-data helper, callsCleanUPSDK(), and verifies that the bot command exits successfully. A companion test verifies that non-Zoom bot commands still use normal interpreter finalization.