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

Bug: Cache timeout under contention #5

Closed
z64 opened this issue Jan 12, 2021 · 0 comments
Closed

Bug: Cache timeout under contention #5

z64 opened this issue Jan 12, 2021 · 0 comments

Comments

@z64
Copy link

z64 commented Jan 12, 2021

Using the demo code here:

https://paste.sr.ht/~z64/05e1209fea4e2d465b75e232720fba1ca72c96f8

Produces output:

$ cr _test.cr google.com 5
...................................................
  0 | 48.33ms
  1 | 48.34ms
  2 | 5024.24ms
  3 | 5024.25ms
  4 | 5024.25ms

because the domain is never removed from the pending list once it is resolved.

The following patch resolves this problem: https://git.sr.ht/~z64/durian.cr/commit/663ca66477d80c2ab8757d8f51669d6dd0e7e328

$ cr _test.cr google.com 5
.
  0 | 51.47ms
  1 | 51.48ms
  2 | 51.48ms
  3 | 51.48ms
  4 | 51.48ms

Please feel free to apply this patch or resolve at your discretion.

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

No branches or pull requests

1 participant