Skip to content

Fix ownership transfer race condition#631

Merged
dooly123 merged 1 commit intoBasisVR:developerfrom
BoatFloater:fix_ownership_race_condition
Mar 13, 2026
Merged

Fix ownership transfer race condition#631
dooly123 merged 1 commit intoBasisVR:developerfrom
BoatFloater:fix_ownership_race_condition

Conversation

@BoatFloater
Copy link
Contributor

Canceling the timeout countdown before setting tcs.TrySetResult with success creates a race condition where tcs.TrySetResult(BasisOwnershipResult.Failed); will actually run first, and the success will be rejected.

Moving cancellationTokenSource.Cancel(); to after tcs.TrySetResult creates a separate race condition where the using block resolves and disposes the CancellationTokenSource before Cancel can be called.

It's safe to just remove this line because it is automatically disposed at that point anyway.

@dooly123 dooly123 merged commit e46c156 into BasisVR:developer Mar 13, 2026
8 checks passed
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.

2 participants