-
Notifications
You must be signed in to change notification settings - Fork 213
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 startup #254
Comments
Could you please show the exact error message you got and steps to reproduce? |
so I effectively coppied your main.go into launch\launch.go see my repro commit |
Thanks, I See. I suppose, for standalone gobetween, just reordering like this may be enough to fix a race condition: // Init metrics
metrics.Start((*cfg).Metrics)
// Init manager
manager.Initialize(*cfg)
// Start API
go api.Start((*cfg).Api) |
fixed by #261 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found this while trying to embed gobetween and not run it standalone so it may not hit as easily in normal case, but the race is still there.
gobetween/main.go
Lines 83 to 89 in 7d8a736
These calls all initialize defaults, however it is possible for the them not to complete before API calls get in. This then ends up in dereference of null.
I hit it in this case.
gobetween/src/manager/manager.go
Line 558 in 7d8a736
Ideally what main should do is run all of these synchronously to init them, and only then launch agents.
The text was updated successfully, but these errors were encountered: