You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Prism] Fix DEADLINE_EXCEEDED errors caused by worker failures (#38523)
* Set b.BundleErr correctly when dynamic split happens.
* Fix deadlock on worker failures by introducing a bundle-level Done signal
The cancellation signal `b.Done` is to abort bundle data streaming immediately
if the worker fails or completes the bundle early.
Without this signal, a deadlock scenario can occur.
- Runner sends elements through data channel
- SDK worker reads and processes the first element, raises an exception
and sends InstructionResponse through control channel. However,
at the same time, Runner keeps sending data and is blocked until
SDK worker reads more data.
- The existed two signals are not sufficient to do an immediate break
- ctx.Done() is closed when the pipeline is done or timeout. Given
the bundle failure, timeout is the only option but it is too late.
- wk.StoppedChan() is closed when the worker is stopped by the worker
pool, which is also not happening when the runner is waiting to
send data.
* Fix a problem of prism log not relaying correctly.
* Trigger more python tests.
* Add a mutex and safe getter/setter methods for bundleErr
* Rename b.Done to b.DataAbort.
* Set bundleErr before closing DataAbort to ensure error will be propagated correctly.
* Refactor Respond to prevent race condition on BundleErr setting
* Remove debug msg
* Formatting.
* Address reviewer comments.
0 commit comments