Skip to content

Conversation

@ok2c
Copy link
Member

@ok2c ok2c commented Apr 25, 2021

@rschmitt Please let me know if you have any objections to this change-set.
@michael-o Please also take a look at HttpRequestRetryStrategy related changes and let me know if everything looks OK.

@ok2c ok2c requested review from michael-o and rschmitt April 25, 2021 13:38
@michael-o
Copy link
Member

@ok2c There is no HttpRequestRetryStrategy related change. I see only async changes. Am I missing something?

@ok2c
Copy link
Member Author

ok2c commented Apr 25, 2021

@michael-o AsyncHttpRequestRetryExec now takes into account HttpRequestRetryStrategy#getRetryInterval value and supports delayed re-execution. I just want to make sure it is in line with your original design.

Copy link
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not really qualified to made a judgement here. My async foo isn't existing. I only have a few inline comments, but will generally leave this to your judgement and other fellow committers.

final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_SERVICE_UNAVAILABLE);
response.addHeader(HttpHeaders.RETRY_AFTER, Long.toString(retryAfter.toSeconds()));
final ProtocolVersion version = request.getVersion();
if (version != null && version.compareToVersion(HttpVersion.HTTP_2) < 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why close if version is 1.1+?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-o It is the other way around. Close connection If the connection is HTTP/1.1 or lower. HTTP/2 connections do not support Connection directives.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my question was misleading. Once again: Why close the connection of th version is exactly 1.1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-o What is the point of keeping the connection alive if the server is unable to serve requests over it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, from an abstract point of view this connection is used to a host:port pair, but the URI path can be proxied to to other backend servers as well. E.g., example.com/service1 and example.com/service2 can be to completely different backends where service1 is offline, but service2 not.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-o I am not sure I understand what it is exactly you are proposing or objecting to.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am neither, I am just trying to clarify that the status code from the server applies solely to the path of the request and it does not give you any idicator that anything else served by this server is unavailable thus making the entire connection invalid . I don't consider the connection to be invalid unless TCP tells me otherwise or the server tells me to close.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-o This is a test class. It is there to merely validate the assumptions of the test case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duh, I am an idiot. I didn't notice this. So this spot is fine. Sorry for the noise.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-o Not at all. Thank you for a thorough review!

@ok2c ok2c force-pushed the HTTPCLIENT-2152 branch from 94eb341 to 5296e57 Compare April 26, 2021 08:07
@michael-o michael-o self-requested a review April 26, 2021 08:22
@michael-o
Copy link
Member

For my uneducated eye this looks fine now.

@rschmitt
Copy link
Contributor

We need to make the I/O reactor more robust. The current amount of surface area for catastrophic production bugs in the async client is totally unacceptable.

@ok2c ok2c merged commit e10ba08 into apache:master Apr 27, 2021
@ok2c ok2c deleted the HTTPCLIENT-2152 branch May 24, 2021 08:52
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.

3 participants