-
Notifications
You must be signed in to change notification settings - Fork 652
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix double remove of handlers (#1091)
* fix double remove of handlers Motivation: Previously, it was possible that a handler was removed twice: Once by Channel teardown and another time by a user-trigger removal that wasn't instantaneous. This racy situation can happen in the real world. NIO behaved wrongly in two ways: 1. we would call `handlerRemoved` twiced 2. ByteToMessageHandler would fail an assertion about the current removal state Modifications: - Only call `handlerRemoved` when the handler actually gets removed. - Fix the assertion. Result: fewer bugs * Update Sources/NIO/ChannelPipeline.swift Co-Authored-By: Cory Benfield <[email protected]>
- Loading branch information
Showing
4 changed files
with
95 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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