Downgrade a relay error to a warning (#545)

- This PR downgrades a relay error that might be
  logged when a connection is closed to a warning.
- Related PR in apple/container#1238.
This commit is contained in:
Dmitry Kovba authored and GitHub committed 2026-02-19 19:43:37 -08:00
1 parent 185b04af74
commit 7dea6dfa66
1 file changed
+8 -1
@@ -211,7 +211,14 @@ public final class BidirectionalRelay: Sendable {
to: destinationFd
)
} catch {
log?.error("file descriptor copy failed \(error)")
log?.warning(
"file descriptor copy failed",
metadata: [
"error": "\(error)",
"sourceFd": "\(sourceFd)",
"destinationFd": "\(destinationFd)",
]
)
if !source.isCancelled {
source.cancel()
if shutdown(destinationFd, Int32(SHUT_RDWR)) != 0 {