Repository navigation
Terminate every universe even if one fails, and don't panic in Drop - #86
Open
stewartadam wants to merge 1 commit into
Open
stewartadam wants to merge 1 commit into
stewartadam wants to merge 1 commit into
Conversation
terminate() returned on the first send error, leaving the remaining universes without termination packets and still registered. It now tries every universe, deregisters each one, and returns the first error. Drop called thread.join().unwrap(), which panics (and aborts the process if already unwinding) when the update thread panicked. The update thread itself panicked on a poisoned mutex; it now exits instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KzaQVPkrkczgX2g7wGkip5
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.
Problem
SacnSourceInternal::terminateused?inside its loop, so the first failed termination send stopped it. The remaining universes never got their termination packets and stayed registered. This is the pathDrop for SacnSourceuses.Drop for SacnSourcecalledthread.join().unwrap(). If the update thread had panicked, that panicked insidedrop, which aborts the process if it happens while already unwinding.trd_src.lock().unwrap()).Fix
terminatetries every universe and deregisters each one, even when its sends fail. It returns the first error after all of them have been attempted.Dropignores the join result.Test
Added a unit test in
source.rsthat swaps the source's socket for a Unix domain socket so every send fails. It checks thatterminatereturns an error, leaves no universes registered, and marks the source as not running. Onmainit fails with all three universes still registered. Unix-only, because it relies onDomain::UNIX.cargo test --libandtests/src_tests.rspass.