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

synchronize access to netrcCredentialHelper.skip #3896

Merged
merged 1 commit into from
Nov 4, 2019

Conversation

nataliechen1
Copy link
Contributor

We run into concurrent map read/write error.
Here is a snippet of the stack trace:
goroutine 664 [running]: runtime.throw(0x9e69e2, 0x21) /usr/local/go1.12/src/runtime/panic.go:617 +0x72 fp=0xc0004e9430 sp=0xc0004e9400 pc=0x42dc92 runtime.mapaccess1_faststr(0x9343c0, 0xc00017b950, 0xc000216308, 0x13, 0x0) /usr/local/go1.12/src/runtime/map_faststr.go:21 +0x469 fp=0xc0004e94a0 sp=0xc0004e9430 pc=0x413fc9 github.com/git-lfs/git-lfs/creds.(*netrcCredentialHelper).Fill(0xc00018b0c0, 0xc00094a420, 0x0, 0xc00094a540, 0x40deb8) work/git-lfs/git-lfs/creds/netrc.go:69 +0xbc fp=0xc0004e9558 sp=0xc0004e94a0 pc=0x75000c github.com/git-lfs/git-lfs/creds.(*CredentialHelpers).Fill(0xc00094a510, 0xc00094a420, 0x0, 0x18, 0xc000216302) work/git-lfs/git-lfs/creds/creds.go:441 +0x29b fp=0xc0004e9630 sp=0xc0004e9558 pc=0x74f28b github.com/git-lfs/git-lfs/creds.(*CredentialHelperWrapper).FillCreds(0xc0004e9858, 0x0, 0x0) work/git-lfs/git-lfs/creds/creds.go:35 +0x51 fp=0xc0004e9700 sp=0xc0004e9630 pc=0x74bbb1 github.com/git-lfs/git-lfs/lfsapi.(*Client).getCreds(0xc000186a40, 0xc0002162ee, 0x8, 0x9d770c, 0x5, 0xc000581400, 0x60, 0xc000478100, 0x0, 0x0, ...) work/git-lfs/git-lfs/lfsapi/auth.go:152 +0x31b fp=0xc0004e98e0 sp=0xc0004e9700 pc=0x7bf54b github.com/git-lfs/git-lfs/lfsapi.(*Client).doWithAuth(0xc000186a40, 0xc0002162ee, 0x8, 0x9d770c, 0x5, 0xc000581400, 0x60, 0xc000478100, 0x0, 0x0, ...) work/git-lfs/git-lfs/lfsapi/auth.go:62 +0xd5 fp=0xc0004e99e0 sp=0xc0004e98e0 pc=0x7bea75 github.com/git-lfs/git-lfs/lfsapi.(*Client).DoWithAuthNoRetry(...) work/git-lfs/git-lfs/lfsapi/auth.go:46

This fix uses a mutex to synchronize access to netrcCredentialHelper.skip.

Copy link
Member

@bk2204 bk2204 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, this seems like a good idea. Thanks for the patch.

@bk2204 bk2204 added this to the v2.9.1 milestone Nov 4, 2019
@bk2204 bk2204 merged commit fb6da61 into git-lfs:master Nov 4, 2019
bk2204 added a commit that referenced this pull request Nov 21, 2019
synchronize access to netrcCredentialHelper.skip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants