-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go/internal/lockedfile: use a retry loop to suppress EDEADLK on A…
…IX and Solaris AIX, Solaris, and Illumos all appear to implement fcntl deadlock detection at the granularity of processes. However, we are acquiring and releasing file locks on individual goroutines running concurrently: our locking occurs at a much finer granularity. As a result, these platforms occasionally fail with EDEADLK errors, when they detect locks that would be _misordered_ in a single-threaded program but are safely _unordered_ in a multi-threaded context. To work around the spurious errors, we treat EDEADLK as always spurious, and retry the failing system call with a bounded exponential backoff. This approach may introduce substantial latency since we no longer benefit from kernel-scheduled wakeups in case of collisions, but high-latency operations seem better than spurious failures. Updates #33974 Updates #35618 Fixes #32817 Change-Id: I58b2c6a0f143bce55d6460fd4ddc3db83577ada7 Reviewed-on: https://go-review.googlesource.com/c/go/+/222277 Reviewed-by: Jay Conrod <[email protected]>
- Loading branch information
Bryan C. Mills
committed
Mar 10, 2020
1 parent
2b8e60d
commit c6f678b
Showing
2 changed files
with
163 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters