Skip to content

Commit 76a9afb

Browse files
authored
Ignore try lock error if it is WouldBlock (#8258)
## Summary Address a TODO comment, seems like we don't need `raw_os_err`?
1 parent b87a755 commit 76a9afb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/uv-fs/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,10 @@ impl LockedFile {
325325
Ok(Self(file))
326326
}
327327
Err(err) => {
328-
// Log error code and enum kind to help debugging more exotic failures
329-
// TODO(zanieb): When `raw_os_error` stabilizes, use that to avoid displaying
330-
// the error when it is `WouldBlock`, which is expected and noisy otherwise.
331-
trace!("Try lock error: {err:?}");
328+
// Log error code and enum kind to help debugging more exotic failures.
329+
if err.kind() != std::io::ErrorKind::WouldBlock {
330+
debug!("Try lock error: {err:?}");
331+
}
332332
info!(
333333
"Waiting to acquire lock for `{resource}` at `{}`",
334334
file.path().user_display(),

0 commit comments

Comments
 (0)