1919
2020import javax .annotation .concurrent .GuardedBy ;
2121import java .io .IOException ;
22+ import java .nio .channels .ClosedByInterruptException ;
2223import java .util .Arrays ;
2324import java .util .ArrayList ;
2425import java .util .BitSet ;
@@ -184,6 +185,10 @@ public long acquireExecutionMemory(long required, MemoryConsumer consumer) {
184185 break ;
185186 }
186187 }
188+ } catch (ClosedByInterruptException e ) {
189+ // This called by user to kill a task (e.g: speculative task).
190+ logger .error ("error while calling spill() on " + c , e );
191+ throw new RuntimeException (e .getMessage ());
187192 } catch (IOException e ) {
188193 logger .error ("error while calling spill() on " + c , e );
189194 throw new OutOfMemoryError ("error while calling spill() on " + c + " : "
@@ -201,6 +206,10 @@ public long acquireExecutionMemory(long required, MemoryConsumer consumer) {
201206 Utils .bytesToString (released ), consumer );
202207 got += memoryManager .acquireExecutionMemory (required - got , taskAttemptId , mode );
203208 }
209+ } catch (ClosedByInterruptException e ) {
210+ // This called by user to kill a task (e.g: speculative task).
211+ logger .error ("error while calling spill() on " + consumer , e );
212+ throw new RuntimeException (e .getMessage ());
204213 } catch (IOException e ) {
205214 logger .error ("error while calling spill() on " + consumer , e );
206215 throw new OutOfMemoryError ("error while calling spill() on " + consumer + " : "
0 commit comments