-
Notifications
You must be signed in to change notification settings - Fork 15
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
Race condition in Dump.Exec #53
Comments
hi @retanik ! I can try your orb options in specific branch. I can't reproduce race condition with your informations. Can you give me :
if you want, you can push a PR for fix issue. |
My estimate is that if you set Exec and streamOutput both access the same variable result.error can be manipulated by the streamOutput at the same time it is read to return from the Exec function. Because the timing is not guaranteed and the result variable has no locking through any kind of mutex for example, this will trigger the race condition warning. hopefully this helps enough to reproduce |
I encountered a race condition detected from go test and after reviewing your CircleCI Orb i see you have it turned off. It might be worth enabling it to catch those cases.
Orb Source line 312+
Race condition was encountered between
and
I was running a unit test which uses suite.run to sequentially trigger multiple database exports. In Exec the streamOutput function is started as a go routine and can not be observed from outside to know when it has finished. I believe that is where the race condition occurs as it is unmanaged writing and reading from the Result.Error variable in both routines
The text was updated successfully, but these errors were encountered: