speechmatics-python icon indicating copy to clipboard operation
speechmatics-python copied to clipboard

Websocket client goes to deadlock

Open BubaVV opened this issue 10 months ago • 0 comments

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:

  1. Create ws client and pass stream with synchronous read() to it
  2. Exhaust read() method, leaving it waiting for input. It imitates transloading from another data source, which can delay sometimes
  3. 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

BubaVV avatar Apr 07 '25 14:04 BubaVV