-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
service hangs after pressing ctrl+C on the client side #255
Comments
I have made another test, defining a dummy pipeline. The dummy pipeline is copied from the transcription pipeline. |
Upated again. I have two points of findings:
The |
I got more update via debugging. I found that whenever the client side is terminated by a Ctrl+C, the on_next will not go into the actuall pipline defined. The status of the Subject() object is completed so on_next does nothing. |
I know the reason now. When ctrl+C is pressed on the client side, the server side cannot send message to client. This will cause exception, but this excepion will change the internal status of stream, so the next client connection is not working as expected. |
@ywangwxd nice catch! Do you mind opening a PR with the fix? Basically, the server shouldn't hang, it should end in an error (because only 1 client is allowed for now) |
Maybe it is imprecise to say it hangs, it is just not working as expected. The on_next function is stilled called, but the pipeline is not executed. I am not familiar with the internal state of the stream. It seems that the stream is already dead internally but did not notify outside users. What I found is actually not the problem of the server side. We can only say the server side has not handled any exceptions from the client side robustly. If the server side does not rely on the client side so tightly, it is okay. |
My code is ugly for a PR. |
The errors are not explicitly sent from the client to the server, this is probably why it seems to hang. However, I don't understand why |
Yeah, the serve should throw an exception or at least reset its status to allow a new client connection. The lattter is reasonable because in the reality there may be various reasons a client can lost its connection. |
How to reproduce:
1, start the server side
2, start the client side
3, press ctrl+C on the client side and restart the client side
Then the server side will hang. The client side will have no output and never ends by itself.
Btw, when a ctrl=C is pressed, an incomplete base64 string may be received on the server side,
so I catch the exception and return a dummy array data, otherwise there will error message like this:
Here is the code where I catch the exception and return the dummy data.
The server side will still hang.
The text was updated successfully, but these errors were encountered: