apache/beam · warning · IOException

executor service was interrupted

Error message

executor service was interrupted

What it means

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.

Source

Thrown at sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/s3/S3FileSystem.java:699

    try {
      return MoreFutures.get(
          MoreFutures.allAsList(
              tasks
                  .map(task -> MoreFutures.supplyAsync(task::call, executorService))
                  .collect(Collectors.toList())));

    } catch (ExecutionException e) {
      if (e.getCause() != null) {
        if (e.getCause() instanceof IOException) {
          throw (IOException) e.getCause();
        }
        throw new IOException(e.getCause());
      }
      throw new IOException(e);

    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new IOException("executor service was interrupted");
    }
  }
}

View on GitHub (pinned to 12126d8942)

Solutions

  1. Let pipeline cancellation complete; retry the operation after the pipeline restarts
  2. Avoid interrupting worker threads performing S3 batch operations
  3. Check upstream cause of the interruption (runner shutdown, timeouts)
  4. Increase operation timeouts or batch sizes if the wait is too long

Example fix

// before
// assuming IOException from rename is a normal failure; retrying immediately
retry(rename(...));
// after
try {
  rename(...);
} catch (IOException e) {
  if (Thread.currentThread().isInterrupted()) {
    throw e; // do not retry while interrupted
  }
  retry(rename(...));
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (Thread.currentThread().isInterrupted()) { /* skip or reschedule operation before calling S3 */ }

Try / catch

try { FileSystems.rename/copy/delete(...); } catch (IOException e) { if (Thread.currentThread().isInterrupted()) { /* honor interruption: stop or rethrow */ } else { retry } }

Prevention

When it happens

Trigger: 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.

Common situations: Pipeline drain/cancel during large S3 renames; runner-initiated timeouts on worker threads.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/dc7d566377441037. Report an issue: GitHub.