File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
server/src/main/java/org/elasticsearch/indices/recovery Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -727,10 +727,6 @@ protected void doRun() throws Exception {
727727 while (true ) {
728728 assert semaphore .availablePermits () == 0 ;
729729 cancellableThreads .checkForCancel ();
730- if (error .get () != null ) {
731- handleErrorOnSendFiles (store , error .get ().v2 (), new StoreFileMetaData []{error .get ().v1 ()});
732- throw error .get ().v2 ();
733- }
734730 if (canSendMore () == false ) {
735731 semaphore .release ();
736732 // Here we have to retry before abort to avoid a race situation where the other threads have flipped `canSendMore`
@@ -740,6 +736,10 @@ protected void doRun() throws Exception {
740736 break ;
741737 }
742738 }
739+ if (error .get () != null ) {
740+ handleErrorOnSendFiles (store , error .get ().v2 (), new StoreFileMetaData []{error .get ().v1 ()});
741+ throw error .get ().v2 ();
742+ }
743743 final FileChunk chunk = readNextChunk ();
744744 if (chunk == null ) {
745745 semaphore .release (); // allow other threads respond if we are not done yet.
You can’t perform that action at this time.
0 commit comments