-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
GraphQL TypeSafe Client in Quarkus Smallrye: Retaining WebSocket Connection Failure in Multi, preventing server reconnection on retry #38595
Comments
/cc @Ladicek (smallrye), @jmartisk (graphql,smallrye), @phillip-kruger (graphql,smallrye), @radcortez (smallrye) |
Hi, could you have a look at smallrye/smallrye-graphql#2030 which is my proposed solution? It turns out we
I'd also suggest replacing your retry logic
with something like
to make sure it is retried more times than just once. |
And one more important thing to note is that this retry logic probably won't work if you shut down the server gracefully, because then it will get a chance to send a proper close status, and the client will treat it as correct shutdown, so the multi will be treated as completed, not failed. You have to For reconnecting when the subscription ends with success, you'd need something like
|
I can't use the withBackOff method cause this method is forbidden when using the until method. Do you have a proper way to retry every Xsecondes until a predicate is true? I use the delay + the recoverWithMulti to be able to change the multi if i need to stop the connections process. By the way the method from my example retry every 5 seconds (no just once) |
Thank you, i will take this into account |
@jmartisk How can i try the code from the pull request? I use maven |
Replied in the PR.
Good question. I'm not really sure why delay + until is forbidden and how to implement it (you could theoretically just implement an |
This solution work for me: |
It's true we can't combine |
Describe the bug
When using the Quarkus Smallry TypeSafe GraphQL client
io.quarkus.quarkus-smallrye-graphql-client
a caching issue is observed in the handling of WebSocket connection failures within the Multi. Specifically, the client retains the failure of the WebSocket connection loss, and during subsequent retries in the Multi, the same failure is reissued in the stream. This behavior prevents the client from attempting to reconnect to the server.
Expected behavior
The client should recognize the WebSocket connection loss, attempt to reconnect, and not cache the previous connection failure during retries in the Multi. The emitter of failure should be invalidated at retry.
Actual behavior
Exception instance:java.net.SocketException@2006a90c
Exception instance:java.net.SocketException@2006a90c
The text was updated successfully, but these errors were encountered: