{"record":{"id":"7d70c5c4bd582241","repo":"apache/iceberg","slug":"interrupted-while-processing-commits","errorCode":null,"errorMessage":"Interrupted while processing commits","messagePattern":"Interrupted while processing commits","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/actions/BaseCommitService.java","lineNumber":128,"sourceCode":"   * @param group group of files which are not yet committed\n   */\n  protected abstract void abortFileGroup(T group);\n\n  /** Starts a single threaded executor service for handling file group commits. */\n  public void start() {\n    Preconditions.checkState(running.compareAndSet(false, true), \"Commit service already started\");\n    LOG.info(\"Starting commit service for {}\", table);\n    committerService.execute(\n        () -> {\n          while (running.get() || !completedRewrites.isEmpty() || !inProgressCommits.isEmpty()) {\n            try {\n              if (completedRewrites.isEmpty() && inProgressCommits.isEmpty()) {\n                // give other threads a chance to make progress\n                Thread.sleep(100);\n              }\n            } catch (InterruptedException e) {\n              Thread.currentThread().interrupt();\n              throw new RuntimeException(\"Interrupted while processing commits\", e);\n            }\n\n            // commit whatever is left once done with writing.\n            if (!running.get() && !completedRewrites.isEmpty()) {\n              commitReadyCommitGroups();\n            }\n          }\n        });\n  }\n\n  /**\n   * Places a file group in the queue and commits a batch of file groups if {@link\n   * BaseCommitService#rewritesPerCommit} number of file groups are present in the queue.\n   *\n   * @param group file group to eventually be committed\n   */\n  public void offer(T group) {\n    LOG.debug(\"Offered to commit service: {}\", group);","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/actions/BaseCommitService.java#L110-L146","documentation":"Thrown from the commit-service executor loop in BaseCommitService.start when the thread is interrupted while waiting for or processing rewrite file-group commits (e.g. by shutdown or cancellation). It marks the single-threaded committer as aborted mid-cycle; already-committed groups remain, pending ones do not.","triggerScenarios":"Thrown at core/src/main/java/org/apache/iceberg/actions/BaseCommitService.java:128 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Avoid shutting down the job/executor while the commit service is still draining in-progress commits","Handle the interruption at the job level and re-run the rewrite action to retry uncommitted groups","Check partial-progress/committed-state before assuming data loss"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}