8000 Release 2.6.0: fix double remove of handlers (#1091) · wolfcon/swift-nio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

2.6.0

@weissi weissi tagged this 31 Jul 15:18
* 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 <lukasa@apple.com>
Assets 2
Loading
0