Files
swift-nio/docs/workarounds.md
George Barnett 663ddc80f2 Dont hold lock over continuation in TokenBucket (#3455)
Motivation:

The various 'withMumbleContinuation' APIs are supposed to be invoked
synchronously with the caller. This assumption allows a lock to be
acquired before the call and released from the body of the
'withMumbleContinuation' after e.g. storing the continuation. However
this isn't the case and the job may be re-enqueued on the executor
meaning that this is pattern is vulnerable to deadlocks.

Modifications:

- Drop and reacquire the lock in TokenBucket.
- Switch to NIOLockedValueBox

Result:

Lower chance of deadlock
2025-12-01 15:46:46 +00:00

22 lines
967 B
Markdown

# Workarounds
The following list of PRs and commits were applied in order to work around bugs
or cases where the Swift compiler was unable to sufficiently optimize the code:
- https://github.com/apple/swift-nio/pull/1374
- https://github.com/apple/swift-nio-ssl/pull/176
- https://github.com/apple/swift-nio/pull/1325
- https://github.com/apple/swift-nio/pull/1299
- https://github.com/apple/swift-nio/pull/1252
- https://github.com/apple/swift-nio/pull/494
- https://github.com/apple/swift-nio/pull/420
- https://github.com/apple/swift-nio/commit/abc963cfe1e1d4856c41421c9d53ea778102e9e8
- https://github.com/apple/swift-nio/pull/1814
- https://github.com/apple/swift-nio/pull/1956
- https://github.com/apple/swift-nio/pull/1961
- https://github.com/apple/swift-nio/pull/2046
- https://github.com/apple/swift-nio/pull/3303
- https://github.com/apple/swift-nio/pull/3452
- https://github.com/apple/swift-nio/pull/3454
- https://github.com/apple/swift-nio/pull/3455