summaryrefslogtreecommitdiff
path: root/ext/io/winpipe.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-03-05 19:17:46 -0700
committerGitHub <noreply@github.com>2024-03-06 03:17:46 +0100
commitbebbb61eea818c83a12c9dedd593016e442805a2 (patch)
tree71de6b3f7bd7df804a2316f0075ce4a760adc862 /ext/io/winpipe.rs
parentace25161c7cbd6e42df82fe8f918efcb8eace9ac (diff)
fix(cli): improve logging on failed named pipe (#22726)
Diffstat (limited to 'ext/io/winpipe.rs')
-rw-r--r--ext/io/winpipe.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/ext/io/winpipe.rs b/ext/io/winpipe.rs
index 1495cbed1..f6e66eeb3 100644
--- a/ext/io/winpipe.rs
+++ b/ext/io/winpipe.rs
@@ -81,7 +81,10 @@ fn create_named_pipe_inner() -> io::Result<(RawHandle, RawHandle)> {
// This should not happen, so we would like to get some better diagnostics here.
// SAFETY: Printing last error for diagnostics
unsafe {
- eprintln!("*** Unexpected server pipe failure: {:x}", GetLastError());
+ eprintln!(
+ "*** Unexpected server pipe failure '{pipe_name:?}': {:x}",
+ GetLastError()
+ );
}
return Err(io::Error::last_os_error());
}
@@ -110,13 +113,19 @@ fn create_named_pipe_inner() -> io::Result<(RawHandle, RawHandle)> {
|| error == winapi::shared::winerror::ERROR_PATH_NOT_FOUND
{
// Exponential backoff, but don't sleep longer than 10ms
- eprintln!("*** Unexpected client pipe not found failure: {:x}", error);
+ eprintln!(
+ "*** Unexpected client pipe not found failure '{pipe_name:?}': {:x}",
+ error
+ );
std::thread::sleep(Duration::from_millis(10.min(2_u64.pow(i) + 1)));
continue;
}
// This should not happen, so we would like to get some better diagnostics here.
- eprintln!("*** Unexpected client pipe failure: {:x}", error);
+ eprintln!(
+ "*** Unexpected client pipe failure '{pipe_name:?}': {:x}",
+ error
+ );
let err = io::Error::last_os_error();
// SAFETY: Close the handles if we failed
unsafe {