Skip to content

Httpclient-2194 async retries not including body#343

Merged
ok2c merged 2 commits intoapache:5.1.xfrom
JasonMathison:HTTPCLIENT-2194_Async_retries_not_including_body
Jan 5, 2022
Merged

Httpclient-2194 async retries not including body#343
ok2c merged 2 commits intoapache:5.1.xfrom
JasonMathison:HTTPCLIENT-2194_Async_retries_not_including_body

Conversation

@JasonMathison
Copy link
Contributor

https://issues.apache.org/jira/browse/HTTPCLIENT-2194

We found that our async retries were failing because there was no body being set. Releasing the entityProducer resets the starting point to 0 and resolved the issue for us.

When applicable call entityProducer.releaseResources() so that on the retry the body will be set.
@JasonMathison JasonMathison changed the base branch from master to 5.1.x January 5, 2022 17:04
public void completed() {
if (state.retrying) {
scope.execCount.incrementAndGet();
if (entityProducer != null && entityProducer.isRepeatable()) {
Copy link
Member

Choose a reason for hiding this comment

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

@JasonMathison Damn. Good catch. However, I propose AsyncEntityProducer#isRepeatable check be dropped here. At this point if the entity producer is not null we should always call AsyncEntityProducer#releaseResources.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR updated.

…r is not null then always call releaseResrouces() when retrying.
@ok2c ok2c merged commit 699467f into apache:5.1.x Jan 5, 2022
@JasonMathison JasonMathison deleted the HTTPCLIENT-2194_Async_retries_not_including_body branch January 5, 2022 21:27
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