What happened:
Premature termination of the gRPC stream (either due to client cancellation or sidecar detected error) must be propagated to the CSI driver by cancelling the context used to create the stream.
A failure to send to the client unwinds in the sidecar, but does not cancel the downstream CSI driver - it would block on its Send call until it times out (if it had set a timeout).
Here the deferred cancel function would force cancellation of the CSI driver's stream either when a local error is detected or if the sidecar's client cancelled its stream.
What happened: Premature termination of the gRPC stream (either due to client cancellation or sidecar detected error) must be propagated to the CSI driver by cancelling the context used to create the stream.
For example, we have logic that looks like this:
A failure to send to the client unwinds in the sidecar, but does not cancel the downstream CSI driver - it would block on its
Send
call until it times out (if it had set a timeout).What you expected to happen:
We should be doing the equivalent of this:
Here the deferred cancel function would force cancellation of the CSI driver's stream either when a local error is detected or if the sidecar's client cancelled its stream.
How to reproduce it:
Anything else we need to know?:
Environment:
kubectl version
):uname -a
):