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

Concurrency issue on accessing shared varible URIMap #359

Closed
yangcao77 opened this issue Feb 25, 2021 · 0 comments · Fixed by devfile/library#66
Closed

Concurrency issue on accessing shared varible URIMap #359

yangcao77 opened this issue Feb 25, 2021 · 0 comments · Fixed by devfile/library#66
Assignees
Labels
area/library Common devfile library for interacting with devfiles kind/bug Something isn't working

Comments

@yangcao77
Copy link
Contributor

yangcao77 commented Feb 25, 2021

To trace cycle reference of the parent uri, a shared variable URIMap is introduced: https://github.com/devfile/library/blob/master/pkg/devfile/parser/context/context.go#L12

However, @mmulholl 's multi-thread test caught the following error due to fatal error: concurrent map writes:

goroutine 58 [running]:
runtime.throw(0x1b9bb93, 0x15)
	/usr/local/go/src/runtime/panic.go:1116 +0x72 fp=0xc0003e1628 sp=0xc0003e15f8 pc=0x1038f52
runtime.mapclear(0x1a893a0, 0xc0001c1350)
	/usr/local/go/src/runtime/map.go:985 +0x171 fp=0xc0003e1660 sp=0xc0003e1628 pc=0x1012f71
github.com/devfile/library/pkg/devfile/parser.parseDevfile(0xc00054e9a8, 0x5, 0xc00043ed20, 0x6c, 0xc0004c80c0, 0x31, 0xc0007e1400, 0x49f, 0x500, 0x1c1dbcd, ...)
	/Users/martinmulholland/devfile/library/pkg/devfile/parser/parse.go:51 +0x199 fp=0xc0003e1798 sp=0xc0003e1660 pc=0x19c6839

/Users/martinmulholland/go/pkg/mod/github.com/xeipuuv/[email protected]/validation.go:41 +0x39
github.com/devfile/library/pkg/devfile/parser/context.(*DevfileCtx).ValidateDevfileSchema(0xc00025a090, 0xc00025a090, 0xc0002fd7e0)
	/Users/martinmulholland/devfile/library/pkg/devfile/parser/context/schema.go:32 +0x119
github.com/devfile/library/pkg/devfile/parser/context.(*DevfileCtx).Validate(...)
	/Users/martinmulholland/devfile/library/pkg/devfile/parser/context/context.go:111

Need to handle the concurrency issue.

@yangcao77 yangcao77 added area/library Common devfile library for interacting with devfiles kind/bug Something isn't working labels Feb 25, 2021
@yangcao77 yangcao77 self-assigned this Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/library Common devfile library for interacting with devfiles kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant