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

Mitigate race condition #11

Merged
merged 3 commits into from
May 7, 2019
Merged

Mitigate race condition #11

merged 3 commits into from
May 7, 2019

Conversation

toli-belo
Copy link

Implement a simple way to mitigate race condition described in #9

anatolii.belomestnov added 2 commits May 6, 2019 10:13
If the job response arrives not too early after submission we wont have any delay penalty
client/client.go Outdated
var ok bool
if handler, ok = client.handlers.Load(resp.Handle); !ok {
// possibly the response arrived faster than the job handler was added to client.handlers, we'll wait a bit and give it another try
time.Sleep(5 * time.Millisecond)

Choose a reason for hiding this comment

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

Pull this out into a constant.

@toli-belo toli-belo merged commit 6460f71 into master May 7, 2019
@toli-belo toli-belo deleted the fix_race branch May 7, 2019 19:53
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