@@ -457,10 +457,6 @@ WorkResponse execInWorker(
457
457
458
458
try {
459
459
response = worker .getResponse (request .getRequestId ());
460
- } catch (InterruptedException e ) {
461
- finishWorkAsync (key , worker , request );
462
- worker = null ;
463
- throw e ;
464
460
} catch (IOException e ) {
465
461
restoreInterrupt (e );
466
462
// If protobuf or json reader couldn't parse the response, try to print whatever the
@@ -518,41 +514,6 @@ WorkResponse execInWorker(
518
514
return response ;
519
515
}
520
516
521
- /**
522
- * Starts a thread to collect the response from a worker when it's no longer of interest.
523
- *
524
- * <p>This can happen either when we lost the race in dynamic execution or the build got
525
- * interrupted. This takes ownership of the worker for purposes of returning it to the worker
526
- * pool.
527
- */
528
- private void finishWorkAsync (WorkerKey key , Worker worker , WorkRequest request ) {
529
- Thread reaper =
530
- new Thread (
531
- () -> {
532
- Worker w = worker ;
533
- try {
534
- w .getResponse (request .getRequestId ());
535
- } catch (IOException | InterruptedException e1 ) {
536
- // If this happens, we either can't trust the output of the worker, or we got
537
- // interrupted while handling being interrupted. In the latter case, let's stop
538
- // trying and just destroy the worker. If it's a singleplex worker, there will
539
- // be a dangling response that we don't want to keep trying to read, so we destroy
540
- // the worker.
541
- try {
542
- workers .invalidateObject (key , w );
543
- w = null ;
544
- } catch (IOException | InterruptedException e2 ) {
545
- // The reaper thread can't do anything useful about this.
546
- }
547
- } finally {
548
- if (w != null ) {
549
- workers .returnObject (key , w );
550
- }
551
- }
552
- });
553
- reaper .start ();
554
- }
555
-
556
517
private static void restoreInterrupt (IOException e ) {
557
518
if (e instanceof InterruptedIOException ) {
558
519
Thread .currentThread ().interrupt ();
0 commit comments