Skip to content

fix: close races in stats sampling and the JavaFX view - #539

Merged
devopvoid merged 5 commits into
mainfrom
fix/client-race-conditions
Nov 5, 2026
Merged

devopvoid merged 5 commits into
mainfrom
fix/client-race-conditions

Conversation

@devopvoid

@devopvoid devopvoid commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner
  • A stats timer whose first sample found the peer closing could not cancel itself and stayed registered. The subscription now checks again once the task is known.
  • VideoView.clear() in JavaFX could be undone by a conversion already running. Frames that came before the clear are now dropped.
  • CustomAudioImpl.beforeRelease() skipped the one of LocalAudioImpl, so a voice activity change still queued reached its handler after the track closed.

The first sample is due at once and may run before its task is known, so it could not cancel it. Check again once the task is set.
The pacer now only counts the ticks due. Pushing into the source moves to a pool of its own, with at most one hand-over per track at a time, and missed ticks are made up for as before.
A conversion runs outside the lock of clear() and could put the old picture back. A generation counter now tells the frames that came before the clear.
CustomAudioImpl.beforeRelease() skipped the one of LocalAudioImpl, so a change still queued reached its handler after the track closed.
@devopvoid devopvoid changed the title fix: close races in stats sampling, custom audio and the JavaFX view fix: close races in stats sampling and the JavaFX view Nov 5, 2026
@devopvoid
devopvoid merged commit 61799cf into main Nov 5, 2026
22 checks passed
@devopvoid
devopvoid deleted the fix/client-race-conditions branch November 5, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant