{"record":{"id":"dc7d566377441037","repo":"apache/beam","slug":"executor-service-was-interrupted","errorCode":null,"errorMessage":"executor service was interrupted","messagePattern":"executor service was interrupted","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"warning","filePath":"sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/S3FileSystem.java","lineNumber":699,"sourceCode":"    try {\n      return MoreFutures.get(\n          MoreFutures.allAsList(\n              tasks\n                  .map(task -> MoreFutures.supplyAsync(task::call, executorService))\n                  .collect(Collectors.toList())));\n\n    } catch (ExecutionException e) {\n      if (e.getCause() != null) {\n        if (e.getCause() instanceof IOException) {\n          throw (IOException) e.getCause();\n        }\n        throw new IOException(e.getCause());\n      }\n      throw new IOException(e);\n\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      throw new IOException(\"executor service was interrupted\");\n    }\n  }\n}\n","sourceCodeStart":681,"sourceCodeEnd":703,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/S3FileSystem.java#L681-L703","documentation":"S3FileSystem's internal executor-service based operations (copy/delete/rename) wrap InterruptedException into an IOException with the message 'executor service was interrupted'. The thread's interrupt flag is re-set before throwing, so callers can still detect the interruption. It signals the worker thread was interrupted while waiting for S3 batch operations to complete.","triggerScenarios":"Cancelling a Beam pipeline while an S3 copy/delete batch is in flight; the worker thread being interrupted due to shutdown or timeout while waiting on executor futures.","commonSituations":"Pipeline drain/cancel during large S3 renames; runner-initiated timeouts on worker threads.","solutions":["Let pipeline cancellation complete; retry the operation after the pipeline restarts","Avoid interrupting worker threads performing S3 batch operations","Check upstream cause of the interruption (runner shutdown, timeouts)","Increase operation timeouts or batch sizes if the wait is too long"],"exampleFix":"// before\n// assuming IOException from rename is a normal failure; retrying immediately\nretry(rename(...));\n// after\ntry {\n  rename(...);\n} catch (IOException e) {\n  if (Thread.currentThread().isInterrupted()) {\n    throw e; // do not retry while interrupted\n  }\n  retry(rename(...));\n}","handlingStrategy":"try-catch","validationCode":"if (Thread.currentThread().isInterrupted()) { /* skip or reschedule operation before calling S3 */ }","typeGuard":null,"tryCatchPattern":"try { FileSystems.rename/copy/delete(...); } catch (IOException e) { if (Thread.currentThread().isInterrupted()) { /* honor interruption: stop or rethrow */ } else { retry } }","preventionTips":["Avoid cancelling pipelines mid-S3-batch-operation when possible","Size copy/delete batches to complete before runner timeouts","Always preserve interrupt status in cleanup code"],"tags":["java","interruption","s3"],"backgroundTag":"thread-interrupted","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-15T02:17:10.978Z"}