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
- 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
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
- 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
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
- Interrupted while waiting for space in buffer
- Support for move options is not yet implemented.
- Unexpected StandardResolveOptions [%s]
- Interrupted closing FlightClient
- Timing number 0b" + timingNumber.toString(2) + " has more th
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/dc7d566377441037.
Report an issue: GitHub.