Skip to content

Commit da2a9e1

Browse files
committed
Change codes.ResourceExhausted from non-final to final error
1 parent 23dd3f1 commit da2a9e1

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

pkg/sidecar-controller/snapshot_controller.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -744,12 +744,19 @@ func isCSIFinalError(err error) bool {
744744
}
745745
switch st.Code() {
746746
case codes.Canceled, // gRPC: Client Application cancelled the request
747-
codes.DeadlineExceeded, // gRPC: Timeout
748-
codes.Unavailable, // gRPC: Server shutting down, TCP connection broken - previous CreateSnapshot() may be still in progress.
749-
codes.ResourceExhausted, // gRPC: Server temporarily out of resources - previous CreateSnapshot() may be still in progress.
750-
codes.Aborted: // CSI: Operation pending for Snapshot
747+
codes.DeadlineExceeded, // gRPC: Timeout
748+
codes.Unavailable, // gRPC: Server shutting down, TCP connection broken - previous CreateSnapshot() may be still in progress.
749+
codes.Aborted: // CSI: Operation pending for Snapshot
751750
return false
752751
}
752+
// Note: codes.ResourceExhausted is treated as a final error.
753+
// gRPC: Server out of resources.
754+
// However, it also could be from the transport layer for "message size exceeded".
755+
// Cannot be decided properly here and needs to be resolved in the spec
756+
// https://github.com/container-storage-interface/spec/issues/419.
757+
// What we assume here for now is that message size limits are large enough that
758+
// the error really comes from the CSI driver.
759+
753760
// All other errors mean that creating snapshot either did not
754761
// even start or failed. It is for sure not in progress.
755762
return true

0 commit comments

Comments
 (0)