Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race condition causing unexpected idle disconnections
This issue may appear when 'send[data]' methods are triggered from different threads. As a result threads race appears between cancelIdleTimeoutExecutor and scheduling new idle task. Example of race: 1. Thread 1 cancels task 2. Thread 2 waits until thread 1 will finish 3. Thread 1 finishes 4. Thread 2 tries to cancel already cancelled task and leaves synchronized block 5. Thread 1 schedules new idle task 6. Thread 2 schedules another idle task, the first is overwritten and never cancelled. As a result disconnection is triggered precisely after set idle timeout passes. Signed-off-by: Mykyta Leonov <[email protected]>
- Loading branch information