Modify

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#17882 closed defect (fixed)

Java HTTP Client is retrying POST requests on its own after 5 minutes

Reported by: Don-vip Owned by: team
Priority: normal Milestone: 19.06
Component: Core Version:
Keywords: http post upload Cc:

Description

Just discovered this:

If a misbehaving remote host doesn't reply to a HTTP POST request within 5 minutes then HTTPClient will silently retry the POST. POST is non-idempotent, but in order to maintain backwards compatibility the sun.net.http.retryPost property was introduced, with a default value of "true": javabug:6382788

Indeed:
https://github.com/unofficial-openjdk/openjdk/blob/2357b5fc925a96e53e6e9a84230be327424ad1ce/src/java.base/share/classes/sun/net/www/http/HttpClient.java#L167

String retryPost = props.getProperty("sun.net.http.retryPost");
if (retryPost != null) {
    retryPostProp = Boolean.parseBoolean(retryPost);
} else {
    retryPostProp = true;
}

We use POST for API diff upload and should make sure to disable this parameter to avoid an unwanted automatic retry.

Attachments (0)

Change History (1)

comment:1 by Don-vip, 6 years ago

Resolution: fixed
Status: newclosed

In 15222/josm:

fix #17882 - Disable automatic HTTP POST retry after 5 minutes, see https://bugs.openjdk.java.net/browse/JDK-6382788

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.