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

ethereum/ratelimit: Fix bug in for timezones behind UTC #505

Merged
merged 2 commits into from Nov 8, 2019

Conversation

@albrow
Copy link
Member

albrow commented Nov 7, 2019

The following error was occurring at certain times of day for timezones that are behind UTC:

{
  "error_string": "rate: Wait(n=1) would exceed context deadline",
  "level": "error",
  "msg": "core app exited with error",
  "myPeerID": "16Uiu2HAkws8tB3zR8m7PQuV5iDNDfYXfShnWBLUeVpdefuTs8mqh",
  "time": "2019-11-06T17:38:55-08:00"
}

To be more specific, the bug seems to occur whenever the current local time is before midnight, but the time in UTC is the next day after midnight. When Mesh enters this state, no Ethereum RPC requests are allowed and Mesh cannot really function effectively.

@albrow albrow changed the title Fix bug in ethereum/ratelimit for timezones behind UTC ethereum/ratelimit: Fix bug in for timezones behind UTC Nov 7, 2019
@albrow

This comment has been minimized.

Copy link
Member Author

albrow commented Nov 7, 2019

@fabioberger I can manually confirm this fixes the bug, but ideally we should write a regression test to prevent this from popping up again. I can't figure out how to do that, and the existing tests always pass in my local timezone, regardless of time of day. Any ideas?

… to UTC in rate limiter
@fabioberger fabioberger self-requested a review Nov 8, 2019
@fabioberger fabioberger merged commit ce1c43c into development Nov 8, 2019
1 check passed
1 check passed
ci/circleci: build Your tests passed on CircleCI!
Details
@fabioberger fabioberger deleted the fix/rate-limit-utc-bug branch Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.