-
Notifications
You must be signed in to change notification settings - Fork 640
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
Simultaneously ping may cause server hangs #2805
Comments
I ran your code several times, and the only errors I see are |
Thank you for your response.
I was under the impression that once a channel failed to communicate, it would be automatically recovered, but I was wrong, and that I would have to manually recreate the channel, is that correct? According to the above log, server-7022 has received a second ping. However, it does not attempt to return the pong. I have no idea why it behaves this way, but anyway, I will try to re-write code to always recreate the channel when it fails. |
I did not say that you should recreate the channel. The call is a separate object from the channel. The channel (or more accurately the client that owns a channel) is the object you create here and the call is the object you create here. You should persist the client object for as long as possible, and you need to create a new call every time there is an error. A call represents a single request, and an error indicates that the request is finished. |
Thank you very much. Now it works. I was not aware of the difference between call and channel correctly. P.S. I have googled documentation on the difference between a call and a channel, but so far have not found a single hit. I assume that the official reference document is probably the only source of information. At least in my native language, I found zero information. |
I suggest starting with the gRPC core concepts document. |
Problem description
When two nodes send messages to each other almost simultaneously, one of two server may hang.
Reproduction steps
Run it two or three times and we will have problems.
Environment
Additional context
This example uses a duplex stream, but I remember that the same problem can occur when written in unary.
But, I am unable to prepare a reproducible code in unary. That is somewhat difficult to reproduce.
The text was updated successfully, but these errors were encountered: