This repository was archived by the owner on Mar 23, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Conversation
Timbus
commented
Dec 19, 2020
Author
Aw, so after a few hours of testing I noticed one.. issue. The HTTP::Client retry logic is broken:
https://github.com/crystal-lang/crystal/blob/master/src/http/client.cr#L585
The client is supposed to reconnect when the server disconnects, but it looks like that code throws an exception and doesn't catch it.. Could be due to the HTTPS wrapper, it's been the culprit in the past. That or the library hasn't kept up with the socket implementation.
So yeah, I might make a PR to crystal-lang to fix this, before you'd wanna merge this.
hkalexling
commented
Dec 19, 2020
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So yeah, this just throws each HTTP::Client in a hash and reuses it if the host matches. I guess you might want to purge the cache in the future? But you'd have to be running it for months to ever really matter..
I switched
urlto a URI to make things a little easier, but I guess you could just do that locally in cached_client if you prefer it as a String