Issue exposed as a test case:
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.
Issue exposed as a test case:
The completion handler runs, but
completionis nil so there is no relation to the initial request. If theclose()operation had succeeded,completionwould be non-nil and the context would be available.