amazon-transcribe-streaming-sdk icon indicating copy to clipboard operation
amazon-transcribe-streaming-sdk copied to clipboard

Future Cancelled Error

Open parikls opened this issue 3 years ago • 1 comments

Eventually during real-time transcription i'm receiving next error:

InvalidStateError: CANCELLED: <Future at 0x7f562153e2b0 state=cancelled>
  File "awscrt/http.py", line 243, in _on_body
    self._on_body_cb(http_stream=self, chunk=chunk)
  File "amazon_transcribe/httpsession.py", line 99, in _on_body
    future.set_result(chunk)
  File "concurrent/futures/_base.py", line 533, in set_result
    raise InvalidStateError('{}: {!r}'.format(self._state, self))

That's actually the full stack-trace so i assume this is being ran in a separate thread (?) and the error is not being propagated. I even can't handle it actually

parikls avatar Dec 07 '21 09:12 parikls

await self.stream.input_stream.end_stream() seemed to fix this for me if anyone else is having issue!

SamComber avatar Feb 23 '24 13:02 SamComber