Open ghost opened 3 years ago
Yup, still happens. Just ran into it on v1.6.6 - Relevant other issue: #7413
still happens on v1.6.12 .....
Is there any workaround or alternative library until this gets fixed?
@mantielero judging from the issue it's about keep-alive, so a workaround would be to create a separate httpclient for a new request.
Is there any workaround or alternative library until this gets fixed?
use puppy instead
@edwardyeung puppy doesn't seem to hold connections at all (like httpclient does), so you can have the same by just creating a new httpclient every request.
In any case, puppy worked for me. Thanks.
@mantielero judging from the issue it's about keep-alive, so a workaround would be to create a separate httpclient for a new request.
I created separate client with newAsyncHttpClient (because I am using async) Unfortunately, it doesn't help.
still happens v1.6.14
@mantielero judging from the issue it's about keep-alive, so a workaround would be to create a separate httpclient for a new request.
I created separate client with newAsyncHttpClient (because I am using async) Unfortunately, it doesn't help.
This obviously works:
import httpclient, os
let client = newHttpClient()
discard client.get("https://quetoo-data.s3.amazonaws.com/")
sleep(10000)
let client2 = newHttpClient()
discard client2.get("https://quetoo-data.s3.amazonaws.com/blah")
HttpClient will raise a ProtocolError "Connection was closed before the full request has been made" if there is a long delay between two requests to the same server (presumably due to keep-alive expiring).
Example
(does not error on some other websites, eg. https://nim-lang.org, but the one above is reliable for me)
Current Output
Expected Output
(does not error)
Additional Information
(also reproducible on Windows and Linux 1.4.2)