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

route_sender: fix possible race with increment_stats #362

Merged
merged 1 commit into from
Nov 19, 2018
Merged

Conversation

kyrylo
Copy link
Contributor

@kyrylo kyrylo commented Nov 16, 2018

Sometimes we have routes that report 0 count. In theory, this should never
happen because if there's a route record, then the count should be at least 1.

I suspect this happens due to a possible race between send and
increment_stats.

This gets executed: @routes[route] ||= RouteStat.new

Then the scheduler switches to send and sends the routes. This essentially
sends the route with zero data.

So far I have no better idea and this is kind of a guess rather than a solid
proof.

Sometimes we have routes that report 0 count. In theory, this should never
happen because if there's a route record, then the count should be at least 1.

I suspect this happens due to a possible race between `send` and
`increment_stats`.

This gets executed: `@routes[route] ||= RouteStat.new`

Then the scheduler switches to `send` and sends the routes. This essentially
sends the route with zero data.

So far I have no better idea and this is kind of a guess rather than a solid
proof.
@kyrylo kyrylo merged commit 17b1b6b into master Nov 19, 2018
@kyrylo kyrylo deleted the race-fix branch November 19, 2018 08:00
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.

1 participant