-
Notifications
You must be signed in to change notification settings - Fork 580
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
@Asynchronous Response in context of FaultTolerance hangs infinitely #6580
Comments
I'm not sure what was the intent of method No need to use a FT annotation there, and it seems that doing so creates some strange "future" interactions (that I didn't analyze in great detail). I'm attaching a simplified version of the client app with changes that seems to work fine. Please verify and possibly close issue. |
Thanks! The whole idea of so much code getAllEntitiesAsync() had was only to troubleshoot because of the hangs seen. Also, I wanted to use the Asynchronous annotation in conjunction with @retries. So the endpoint alternates between a 200 response and 500 response status code that gets translated to GreetResourceEndpointException as we have registered the exception mapper GreetClientExceptionMapper as a provider to the Rest Client. We expect a retry to happen in case of GreetResourceEndpointException that should give back a 200 response (Ref to commented @Retry annotation in the RestClient method CompletionStage getMessageAsync(); The method planned to use with FT annotation is:
|
Using this as reference here: https://download.eclipse.org/microprofile/microprofile-fault-tolerance-3.0/microprofile-fault-tolerance-spec-3.0.html#_interactions_when_returning_a_code_completionstage_code ``If an exceptionally completed CompletionStage is returned, or if an incomplete CompletionStage is returned which later completes exceptionally, then this will cause other specified Fault Tolerance policies to be applied.'' |
@nehamunjal I get the idea behind the retries now. I will check that, but I can see what may be happening: with |
I can confirm there's a problem with |
Follow-up is issue #6696. |
Environment Details
A RestClient:
Bean that Injects the RestClient (Apologies for so many println statements, added only to troubleshoot this further):
Exception Mapper:
The service alternately hands over an erroneous response and valid response.
Curl command used to invoke the client Bean: curl -v http://localhost:8090/entityBeanFT/asyncHandler
I am noticing that after the 1st call (which is successful), the 2nd one (expected to be erroneous), just waits or hangs indefinitely with no result. Also, tried to use @Retry annotation with @asynchronous to recover from exception, but the calls just hang forever. Tried to use and follow as documented @ https://download.eclipse.org/microprofile/microprofile-fault-tolerance-3.0/microprofile-fault-tolerance-spec-3.0.html#_asynchronous_usage, but could not get it working.
Reproducer:
quickstart-mp-server.zip
quickstart-mp.zip
The text was updated successfully, but these errors were encountered: