Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go/internal/lockedfile: spurious EDEADLK failures on AIX and Solaris #32817

Closed
bcmills opened this issue Jun 27, 2019 · 6 comments
Closed
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-AIX OS-illumos OS-Solaris
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Jun 27, 2019

From https://build.golang.org/log/f268986231f8f43781dacb0f5fe56772143ca24b (on aix-ppc64):

go test proxy running at GOPROXY=http://127.0.0.1:34444/mod
--- FAIL: TestScript (0.00s)
    --- FAIL: TestScript/mod_concurrent (1.51s)
        script_test.go:191: 
            # Concurrent builds should succeed, even if they need to download modules. (0.924s)
            > go build ./x &
            > go build ./y
            [stderr]
            go: can't lock version list lockfile: Lock $WORK/gopath/pkg/mod/cache/download/golang.org/x/text/@v/list.lock: deadlock condition if locked
            [exit status 1 (core dumped)]
            FAIL: testdata/script/mod_concurrent.txt:5: unexpected command failure
            
FAIL
FAIL	cmd/go	106.612s

I suspect that this is actually an AIX kernel bug (namely, being overly pessimistic about the deadlock properties of file locks in a multi-threaded program), but perhaps we should consider some sort of workaround.

CC @Helflym @jayconrod

@bcmills bcmills added modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-AIX labels Jun 27, 2019
@bcmills bcmills added this to the Unplanned milestone Jun 27, 2019
@Helflym
Copy link
Contributor

Helflym commented Jun 28, 2019

Yeah, I'm already aware of this bug. I know that it can happen sometimes on AIX 7.2 TL0.
However, I think that's the first time I'm seeing it on AIX 7.2 TL2 (the AIX version on the builder)...

I've made a old workaround a few months back (cf CL 152718). It could be updated and merged if we need a quick workaround while we're trying to find a true fix (if any).

@bradfitz
Copy link
Contributor

bradfitz commented Nov 4, 2019

Approximately the same thing on Illumos:

https://build.golang.org/log/2b8036635d51414fe4f6f3421dee2e27bc2a6577

It returns deadlock situation detected/avoided, which is error EDEADLK.

/cc @jclulow

@bcmills bcmills changed the title cmd/go: TestScript/mod_concurrent flake on aix-ppc64 builder cmd/go/internal/lockedfile: spurious EDEADLK failures on AIX and Solaris Nov 15, 2019
@bcmills
Copy link
Contributor Author

bcmills commented Nov 15, 2019

Illumos, at least, seems to have an flock implementation now, and the other platforms that provide flock do not seem to exhibit EDEADLK flakes.

So probably the ideal solution on that platform is to implement syscall.Flock (filed as #35618) and adjust the tags for lockedfile/internal/filelock to use the flock variant on illumos.

@gopherbot
Copy link
Contributor

gopherbot commented Mar 5, 2020

Change https://golang.org/cl/222277 mentions this issue: cmd/go/internal/modload: use a retry loop to suppress EDEADLK on AIX and Solaris

@bcmills bcmills modified the milestones: Unplanned, Go1.15 Mar 10, 2020
@bcmills
Copy link
Contributor Author

bcmills commented Mar 10, 2020

Amusingly, the regression test I added closely parallels this nearly-19-year-old bug report!
https://bugzilla.mozilla.org/show_bug.cgi?id=62457#c5

@golang golang locked and limited conversation to collaborators Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-AIX OS-illumos OS-Solaris
Projects
None yet
Development

No branches or pull requests

4 participants