speechmatics-python
speechmatics-python copied to clipboard
Websocket client goes to deadlock
Websocket client locks the whole task manager when consume sync stream as input, it reaches end or input waiting, and server disconnects stream during this wait
Reproduce Check the PR: https://github.com/speechmatics/speechmatics-python/pull/117
TL,DR:
- Create ws client and pass stream with synchronous read() to it
- Exhaust read() method, leaving it waiting for input. It imitates transloading from another data source, which can delay sometimes
- Disconnect the stream from server. IRL it was idle timeout event, test do the same, but faster
Expected behavior Also in PR. Async stream works as expected - not locking and handles disconnect event
I added modification for disconnect from server mocking disconnect by idle timeout. It works correctly with the all other tests