Skip to content

Commit 28c6340

Browse files
committed
openat2: increase retry count to 128
We have seen reports of users hitting the 32 retry limit, hopefully a 4x increase is enough to ease the pain. Ultimately, as a result of commit 02d2e4b ("gopathrs: return raw errors from openat2 retry loop") it is practical for callers to do their own top-level infinite retry loop if intermittent failures are unacceptable for their use-case. Signed-off-by: Aleksa Sarai <[email protected]>
1 parent b840126 commit 28c6340

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pathrs-lite/internal/fd/openat2_linux.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ func scopedLookupShouldRetry(how *unix.OpenHow, err error) bool {
3232
(errors.Is(err, unix.EAGAIN) || errors.Is(err, unix.EXDEV))
3333
}
3434

35-
const scopedLookupMaxRetries = 32
35+
// This is a fairly arbitrary limit we have just to avoid an attacker being
36+
// able to make us spin in an infinite retry loop -- callers can choose to
37+
// retry on EAGAIN if they prefer.
38+
const scopedLookupMaxRetries = 128
3639

3740
// Openat2 is an [Fd]-based wrapper around unix.Openat2, but with some retry
3841
// logic in case of EAGAIN errors.

0 commit comments

Comments
 (0)