convergencelabs / convergence-project

The project used for Convergence Project Management and Issue Reporting
https://convergence.io
42 stars 5 forks source link

Convergence Server does not complete web socket close handhsake. #218

Closed mmacfadden closed 3 years ago

mmacfadden commented 3 years ago

Versions

Describe the Bug When the javascript client tries to close the connection, the close process does not complete cleanly, and often waits for a timeout. This is because the server is not sending back the web socket close FIN message. It is supposed to work as follows:

Client.close() -> Web Socket Close [code, message] -> Server ->  Server Close Event Fired
                                                       |
Client <- Web Socket Close[same code, same message] <--|
  |
  |--> Client Close Event Fired

Without the server sending the TCP FIN message back to the client, the client will wait until whatever timeout the specific implementation provides. This often results in a protracted delay, as well as an error event being emitted.

Expected Behavior The server should properly complete the close request.

mmacfadden commented 3 years ago

This is related to the following Akka HTTP issue.

https://github.com/akka/akka-http/issues/1358

The key information being in this comment: https://github.com/akka/akka-http/issues/1358#issuecomment-366741028

We need to update the server to use fromSinkAndSourceCoupled instead of fromSinkAndSource in the WebSocketService.