Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.2-Ducc
-
None
Description
The pull service error handling in HttpServiceTransport.dispatch() is not optimal. While it is catching and handling some exceptions like
NoHttpResponseException
HttpHostConnectException
UnknownHostException
its not handling other ones that HttpClient.execute() may throw.
Simplify handling of exceptions from HttpClient.execute() by simply catching any IOException and automatically retry until success. The HttpClient.execute() API is documented as:
HttpResponse org.apache.http.client.HttpClient.execute(HttpUriRequest request) throws IOException, ClientProtocolException
Note: the ClientProtocolException is a kind of (extends from) IOException
Also, the http client may succeed but returns status code != 200. In such case, we should also retry.