IORing: `blockingConsumeCompletions()` drops context on error
Open
- Dominant language
- Swift
- Stars
- 1.4k
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
Issue exposed as a test case:
```swift
extension IORingTests {
func testMinimalContextLoss() throws {
var ring = try IORing(queueDepth: 4)
_ = try ring.submit(
linkedRequests: .close(FileDescriptor(rawValue: -1), context: 42)
)
var received: UInt64? = nil
ring.blockingConsumeCompletions { completion, _, _ in
received = completion?.context
}
XCTAssertEqual(received, 42) // fails: received is nil
}
}
```
The completion handler runs, but `completion` is nil so there is no relation to the initial request. If the `close()` operation had succeeded, `completion` would be non-nil and the context would be available.
Contributor guide
Assessment
This issue has not been assessed yet.