Skip to content

Core: Fix garbled commit-timeout message using unsupported {} placeholders#17110

Open
anxkhn wants to merge 1 commit into
apache:mainfrom
anxkhn:fix/commit-service-timeout-message
Open

Core: Fix garbled commit-timeout message using unsupported {} placeholders#17110
anxkhn wants to merge 1 commit into
apache:mainfrom
anxkhn:fix/commit-service-timeout-message

Conversation

@anxkhn

@anxkhn anxkhn commented Jul 6, 2026

Copy link
Copy Markdown

What changed

BaseCommitService.close() throws an IllegalArgumentException via Guava
Preconditions.checkArgument when the commit pool does not finish within the
configured timeout (the rewrite/compaction commit-timeout path). The message
template used SLF4J-style {} placeholders:

Preconditions.checkArgument(
    !timeout && completedRewrites.isEmpty(),
    "Timeout occurred when waiting for commits to complete. "
        + "{} file groups committed. {} file groups remain uncommitted. "
        + "Retry this operation to attempt rewriting the failed groups.",
    committedRewrites.size(),
    completedRewrites.size());

Guava's Preconditions message formatter only understands %s, not {}.
Because the placeholders never match, both {} are printed literally and the
two count arguments are appended in a trailing [x, y] bracket. Operators who
hit a commit timeout therefore see a garbled diagnostic, for example:

Timeout occurred when waiting for commits to complete. {} file groups committed.
{} file groups remain uncommitted. Retry this operation to attempt rewriting the
failed groups. [0, 0]

The fix

Replace the two {} with %s so the committed and uncommitted counts are
substituted inline. The two existing arguments (committedRewrites.size(),
completedRewrites.size()) already line up positionally with the two %s, and
the wording is unchanged. The correct {} usage just above (the LOG.warn at
BaseCommitService.java:176) is a genuine SLF4J call, which is the likely
source of the copy-paste.

Test

Strengthens the existing regression test
TestCommitService.testAbortFileGroupsAfterTimeout so it guards this bug: in
addition to the existing hasMessageContaining("Timeout occurred when waiting for commits"), it now asserts the message contains no literal {} and that the
counts render inline (N file groups committed. N file groups remain uncommitted.). Reverting only the source change makes the test fail on the
{} assertion; the fix makes it pass.

./gradlew :iceberg-core:spotlessCheck
./gradlew :iceberg-core:test --tests "org.apache.iceberg.actions.TestCommitService"

both pass (2 tests, 0 failures).

Notes


AI Disclosure

  • Model: Claude Opus 4.8
  • Platform/Tool: opencode
  • Human Oversight: fully reviewed
  • Prompt Summary: Fix the rewrite commit-timeout IllegalArgumentException message in BaseCommitService, which used SLF4J {} placeholders inside a Guava Preconditions.checkArgument (which only supports %s), and add a regression assertion.

…lders

BaseCommitService.close throws an IllegalArgumentException via
Guava Preconditions.checkArgument when the commit pool does not finish
within the timeout. The message used SLF4J-style {} placeholders, but
Guava's message formatter only understands %s. As a result the two {}
were printed literally and the file-group counts were appended in a
trailing [x, y] bracket, so operators saw a garbled message on the
rewrite/compaction commit-timeout path.

Replace the two {} with %s so the committed and uncommitted counts are
substituted inline. Strengthen TestCommitService.testAbortFileGroupsAfterTimeout
to assert the counts appear inline and that no literal {} remains.

Generated-by: opencode
@github-actions github-actions Bot added the core label Jul 6, 2026
@nastra

nastra commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

I did a quick scan across the codebase using Claude and we have a few other places that are affected. Could you please fix those as well?

Location Message
flink/v1.20/.../ListFileSystemFiles.java:102 "Cannot use prefix listing with FileIO {} which does not support prefix operations."
flink/v2.0/.../ListFileSystemFiles.java:102 same
flink/v2.1/.../ListFileSystemFiles.java:102 same
spark/v3.5/.../DeleteOrphanFilesSparkAction.java:420 same
spark/v4.0/.../DeleteOrphanFilesSparkAction.java:420 same
spark/v4.1/.../DeleteOrphanFilesSparkAction.java:420 same
spark/v3.5/.../AsyncSparkMicroBatchPlanner.java:131 "AsyncSparkMicroBatchPlanner for {} was already stopped"
spark/v4.0/.../AsyncSparkMicroBatchPlanner.java:131 same
spark/v4.1/.../AsyncSparkMicroBatchPlanner.java:131 same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants