Repository navigation
Fix a deadlock in TaskLoop - #840
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #840 +/- ##
==========================================
+ Coverage 87.15% 87.30% +0.15%
==========================================
Files 43 43
Lines 4819 4821 +2
==========================================
+ Hits 4200 4209 +9
+ Misses 445 438 -7
Partials 174 174
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
philipch07
reviewed
Nov 26, 2025
philipch07
approved these changes
Nov 26, 2025
philipch07
left a comment
Member
There was a problem hiding this comment.
Sorry, I meant to approve + ask the question. The test looks fine; the question is just about a possible enhancement but isn't make-or-break^
Sean-Der
approved these changes
Nov 26, 2025
boks1971
added a commit
to livekit/livekit
that referenced
this pull request
Nov 27, 2025
After adding more fields in https://github.com/livekit/livekit/pull/4105/files, it was not even logging. Access to one of the added fields must have ended up waiting on a lock and blocked. Unfotunately, the deadlock fix in pion/ice#840 did not address the peer connection close hang. Splitting the logs so that the base log still happens. Ordering after looking at the code and guessing what could still log to see if we get more of the logs and learn more about the state and which lock ends up the first blocking one.
boks1971
added a commit
to livekit/livekit
that referenced
this pull request
Nov 27, 2025
After adding more fields in https://github.com/livekit/livekit/pull/4105/files, it was not even logging. Access to one of the added fields must have ended up waiting on a lock and blocked. Unfotunately, the deadlock fix in pion/ice#840 did not address the peer connection close hang. Splitting the logs so that the base log still happens. Ordering after looking at the code and guessing what could still log to see if we get more of the logs and learn more about the state and which lock ends up the first blocking one.
zeekay
pushed a commit
to hanzoai/livekit
that referenced
this pull request
Sep 9, 2026
After adding more fields in https://github.com/livekit/livekit/pull/4105/files, it was not even logging. Access to one of the added fields must have ended up waiting on a lock and blocked. Unfotunately, the deadlock fix in pion/ice#840 did not address the peer connection close hang. Splitting the logs so that the base log still happens. Ordering after looking at the code and guessing what could still log to see if we get more of the logs and learn more about the state and which lock ends up the first blocking one.
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.
Description
Fixes a rare race condition in taskloop if close fired just while Run was getting called in the tiny window after the err check and just before Run gets called, and because the context is actually set to the loop itself we get a deadlock.
Reference issue
I saw it happening this week and I think it Fixes pion/interceptor#384 but not 100% sure