File tree Expand file tree Collapse file tree
java-storage/google-cloud-storage/src/main/java/com/google/cloud/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,7 +165,8 @@ public void flush() {
165165 public boolean finishWrite (long length ) {
166166 lock .lock ();
167167 try {
168- if (state .getState () == State .TERMINAL_SUCCESS ) {
168+ State currentState = state .getState ();
169+ if (currentState == State .TERMINAL_SUCCESS || currentState == State .TERMINAL_ERROR ) {
169170 return true ;
170171 }
171172 // if we're already finalizing, ack rather than enqueueing again
@@ -195,7 +196,8 @@ public boolean closeStream(long length) {
195196 lock .lock ();
196197 try {
197198
198- if (state .getState () == State .TERMINAL_SUCCESS ) {
199+ State currentState = state .getState ();
200+ if (currentState == State .TERMINAL_SUCCESS || currentState == State .TERMINAL_ERROR ) {
199201 return true ;
200202 }
201203
You can’t perform that action at this time.
0 commit comments