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

[WIP] Ensure request callback is invoked on client connection error #1939

Closed

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Nov 4, 2019

This PR addresses the apparent lack of response when HTTP connections fail, such as with invalid URLs (issue #1937).

When a HTTP request is issued a completed delgate is supplied, which receives a boolean successful parameter. This parameter is false if HTTP parsing fails or the remote connection returns an HTTP error code.

If, when sending the request, a failure occurs in the connection process then the callback is never invoked. This can happen if:

  • The server address specified cannot be resolved (DNS failure)
  • A TCP connection cannot be made to the server (no service on the specified port)

And probabaly others. These failures are permanent and if notifed the application can act on them promptly. The alternative is implementing a separate timeout mechanism and just giving up.

So this PR catches a TCP error condition and invokes the request completed delegate with a failure code.
The request remains on the waiting queue though, so the request will continue to be retried.

@slaff slaff added this to the 4.0.1 milestone Nov 4, 2019
@slaff slaff removed this from the 4.1.0 milestone Feb 6, 2020
@mikee47 mikee47 force-pushed the develop branch 2 times, most recently from 7b19c1b to 295a5f3 Compare February 22, 2021 15:50
@mikee47 mikee47 force-pushed the fix/HttpClient-error-callback branch from cbc43ae to bee6408 Compare October 22, 2021 14:45
@mikee47 mikee47 force-pushed the fix/HttpClient-error-callback branch from bee6408 to fce927b Compare March 7, 2022 13:23
@slaff slaff added this to the 4.6.0 milestone Mar 9, 2022
@slaff
Copy link
Contributor

slaff commented Mar 9, 2022

@mikee47 ping me when ready with this PR so I can test it.

@slaff slaff modified the milestones: 4.6.0, 4.7.0 Jun 22, 2022
@mikee47 mikee47 force-pushed the fix/HttpClient-error-callback branch 3 times, most recently from f3271f6 to 0b293bb Compare March 25, 2024 19:51
@mikee47 mikee47 force-pushed the fix/HttpClient-error-callback branch 2 times, most recently from d7dd0a1 to 584e95f Compare June 22, 2024 20:42
@mikee47
Copy link
Contributor Author

mikee47 commented Jun 23, 2024

Closing until issue #2829 is scoped.

@mikee47 mikee47 closed this Jun 23, 2024
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.

2 participants