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

Consider: extend ExponentialRetryPolicy to retry failed connections #116

Closed
joostdenijs opened this issue Jul 16, 2012 · 1 comment
Closed
Milestone

Comments

@joostdenijs
Copy link
Contributor

Moved from private repository.

If there is a network hiccup, like the HTTP connection to the server fails (which I've observed then stressing the real Azure service), Jersey can throw "com.sun.jersey.api.client.ClientHandlerException: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: Software caused connection abort: recv failed"

This is not currently retried under the RetryPolicy, and requires an additional layer of retry logic to be built, which just adds to the overall weight of the customer's solution.

Had this happen again while running my Table tests.

The Storage team recommends that all service requests be made using retry logic, in case of transient network issues. Our service layer provides an ExponentialRetryPolicy to allow for retry on specific HTTP erorrs, but we don't have anything in place for lower-level issues, like " SocketException: Unexpected end of file from server"

It would be good to add auto-retry support for non-HTTP errors, so users don't have to duplicate those same lines of code in every application they write.

com.microsoft.windowsazure.services.core.ServiceException: com.sun.jersey.api.client.ClientHandlerException: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: Unexpected end of file from server
at com.microsoft.windowsazure.services.table.implementation.TableExceptionProcessor.insertOrReplaceEntity(TableExceptionProcessor.java:341)
at ext.microsoft.windowsazure.blobAndQueueSample.TableTest.updateInfo(TableTest.java:229)
at ext.microsoft.windowsazure.blobAndQueueSample.TableTest.IterationRun(TableTest.java:70)
at ext.microsoft.windowsazure.blobAndQueueSample.StressBase.run(StressBase.java:67)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.sun.jersey.api.client.ClientHandlerException: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: Unexpected end of file from server
at com.microsoft.windowsazure.services.core.utils.pipeline.ClientFilterAdapter.handle(ClientFilterAdapter.java:52)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:670)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.method(WebResource.java:613)
at com.microsoft.windowsazure.services.table.implementation.TableRestProxy.putOrMergeEntityCore(TableRestProxy.java:533)
at com.microsoft.windowsazure.services.table.implementation.TableRestProxy.insertOrReplaceEntity(TableRestProxy.java:506)
at com.microsoft.windowsazure.services.table.implementation.TableRestProxy.insertOrReplaceEntity(TableRestProxy.java:500)
at com.microsoft.windowsazure.services.table.implementation.TableExceptionProcessor.insertOrReplaceEntity(TableExceptionProcessor.java:335)
... 4 more
Caused by: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: Unexpected end of file from server
at com.microsoft.windowsazure.services.core.utils.pipeline.HttpURLConnectionClientHandler.handle(HttpURLConnectionClientHandler.java:172)
at com.sun.jersey.api.client.filter.LoggingFilter.handle(LoggingFilter.java:183)
at com.microsoft.windowsazure.services.blob.implementation.SharedKeyFilter.handle(SharedKeyFilter.java:72)
at com.sun.jersey.api.client.Client.handle(Client.java:648)
at com.microsoft.windowsazure.services.core.utils.pipeline.ClientFilterAdapter$1.handle(ClientFilterAdapter.java:45)
at com.microsoft.windowsazure.services.core.RetryPolicyFilter.handle(RetryPolicyFilter.java:48)
at com.microsoft.windowsazure.services.core.utils.pipeline.ClientFilterAdapter.handle(ClientFilterAdapter.java:43)
... 11 more
Caused by: java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:777)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:640)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:660)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
at com.microsoft.windowsazure.services.core.utils.pipeline.HttpURLConnectionClientHandler.doHandle(HttpURLConnectionClientHandler.java:239)
at com.microsoft.windowsazure.services.core.utils.pipeline.HttpURLConnectionClientHandler.handle(HttpURLConnectionClientHandler.java:169)
... 17 more

gcheng pushed a commit to gcheng/azure-sdk-for-java that referenced this issue May 17, 2013
fix a unit test failure for topic info.
@andrerod
Copy link

We've moved to Apache

g2vinay pushed a commit to g2vinay/azure-sdk-for-java that referenced this issue Mar 4, 2019
[Java] Support Custom ClassLoader
mssfang pushed a commit to mssfang/azure-sdk-for-java that referenced this issue Apr 23, 2019
…e#116)

* Change not retry receive on receiving expired messages, if the receive request already timed out.

* Change to allow QueueClient creation with a listen only SAS key.

* minor tweak to closeSender method
openapi-sdkautomation bot referenced this issue in AzureSDKAutomation/azure-sdk-for-java Aug 14, 2019
[pull] master from Azure:master
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants