-
Notifications
You must be signed in to change notification settings - Fork 638
fix(middleware-sdk-transcribe-streaming): close sockets on WebSocketHandler.destroy() #4400
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
Conversation
…ocketHandler to store sockets
d9032e2 to
445c315
Compare
0eb4d4d to
c54d772
Compare
b83b29c to
b75951f
Compare
| /** | ||
| * Removes all closing/closed sockets from the socket pool for URL. | ||
| */ | ||
| private removeNotUsableSockets(url: string): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to removeClosedSockets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was originally named removeClosedSockets
It removes Closing sockets too, that's why I'd renamed it from Closed to NotUsable.
| handler.destroy(); | ||
|
|
||
| // Verify that socket.close() is called | ||
| expect(socket.readyState).toBe(WebSocket.CLOSING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on what timing does this transition to WebSocket.CLOSED?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried timeouts of 1s and 5s, but the state was still closing.
That's why I updated source code to remove sockets with closing state, and verified state to be closing.
packages/middleware-sdk-transcribe-streaming/src/websocket-handler.ts
Outdated
Show resolved
Hide resolved
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Issue
Fixes #3922
Description
Closes sockets on WebSocketHandler.destroy()
Testing
CI
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.