{"record":{"id":"f29e7be6822d6a09","repo":"apache/beam","slug":"interrupted-backoff-of-file-copies-with-retries-sample-from","errorCode":null,"errorMessage":"Interrupted backoff of file copies with retries, sample: from %s to %s due to %s","messagePattern":"Interrupted backoff of file copies with retries, sample: from (.+?) to (.+?) due to (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"warning","filePath":"sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/util/GcsUtilV1.java","lineNumber":1239,"sourceCode":"        long backOffMillis = backoff.nextBackOffMillis();\n        if (backOffMillis == org.apache.beam.sdk.util.BackOff.STOP) {\n          throw new IOException(\n              String.format(\n                  \"Error completing file copies with retries, sample: from %s to %s due to %s\",\n                  sampleErrorOp.getFrom().toString(),\n                  sampleErrorOp.getTo().toString(),\n                  sampleErrorOp.getLastError()));\n        }\n        LOG.warn(\n            \"Retrying with backoff unsuccessful copy requests, sample request: from {} to {} due to {}\",\n            sampleErrorOp.getFrom(),\n            sampleErrorOp.getTo(),\n            sampleErrorOp.getLastError());\n        try {\n          Thread.sleep(backOffMillis);\n        } catch (InterruptedException e) {\n          Thread.currentThread().interrupt();\n          throw new IOException(\n              String.format(\n                  \"Interrupted backoff of file copies with retries, sample: from %s to %s due to %s\",\n                  sampleErrorOp.getFrom().toString(),\n                  sampleErrorOp.getTo().toString(),\n                  sampleErrorOp.getLastError()));\n        }\n      }\n      executeBatches(batches);\n    }\n  }\n\n  LinkedList<RewriteOp> makeRewriteOps(\n      Iterable<String> srcFilenames,\n      Iterable<String> destFilenames,\n      boolean deleteSource,\n      boolean ignoreMissingSource,\n      boolean ignoreExistingDest)\n      throws IOException {","sourceCodeStart":1221,"sourceCodeEnd":1257,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/util/GcsUtilV1.java#L1221-L1257","documentation":"Thrown by GcsUtilV1 when the thread sleeping between GCS copy-retry backoff rounds is interrupted. The library restores the interrupt flag before throwing so callers can detect shutdown. It wraps the same sample rewrite error as the retry-exhausted case but signals cancellation rather than failure.","triggerScenarios":"Inside GcsUtilV1.fileCopyRewrite's retry loop, Thread.sleep(backOffMillis) throws InterruptedException because the executing thread was interrupted (e.g. pipeline cancellation, executor shutdown).","commonSituations":"Cancelling a Dataflow/Beam pipeline mid-copy; application shutdown while a staged-file copy is in progress; a Future.get timeout path that interrupts the worker thread.","solutions":["Treat as intentional cancellation: check whether the pipeline/job was cancelled and stop retrying.","If interruption is unexpected, audit thread pools that might interrupt worker threads during shutdown.","Re-run the copy operation after the cancellation cause is resolved.","Keep the Thread.currentThread().interrupt() semantics: don't swallow the flag in surrounding code."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  gcsUtil.fileCopyRewrite(srcs, dsts);\n} catch (IOException e) {\n  if (Thread.currentThread().isInterrupted() || e.getMessage().startsWith(\"Interrupted backoff\")) {\n    LOG.info(\"Copy cancelled; skipping\");\n    return;\n  }\n  throw e;\n}","preventionTips":["Avoid interrupting worker threads while GCS copy batches run; drain via cancellation flags","Check job/pipeline cancellation status before interpreting this as a real failure"],"tags":["gcs","interrupted","thread","java","apache-beam"],"backgroundTag":"thread-interrupted","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}