Skip to content

timeout feature for runSync (per table)#823

Open
sapienza88 wants to merge 8 commits into
apache:mainfrom
sapienza88:run_sync_timeout
Open

timeout feature for runSync (per table)#823
sapienza88 wants to merge 8 commits into
apache:mainfrom
sapienza88:run_sync_timeout

Conversation

@sapienza88

@sapienza88 sapienza88 commented May 18, 2026

Copy link
Copy Markdown
Contributor

This pull request adds support for configuring a per-table timeout for the RunSync utility. A new --syncTimeout CLI option allows users to specify the maximum amount of time a single table sync is allowed to run before it is interrupted, preventing long-running or stalled sync operations from blocking subsequent work.

Selim Soufargi added 2 commits May 18, 2026 21:25
Comment thread xtable-core/src/test/java/org/apache/xtable/ITConversionController.java Outdated
Comment thread xtable-utilities/src/main/java/org/apache/xtable/utilities/RunSync.java Outdated
Comment thread xtable-utilities/src/main/java/org/apache/xtable/utilities/RunSync.java Outdated
Comment thread xtable-utilities/src/main/java/org/apache/xtable/utilities/RunSync.java Outdated
Comment thread xtable-utilities/src/main/java/org/apache/xtable/utilities/RunSync.java Outdated
Comment thread xtable-utilities/src/main/java/org/apache/xtable/utilities/RunSync.java Outdated
Comment thread xtable-utilities/src/main/java/org/apache/xtable/utilities/RunSync.java Outdated
@MethodSource("generateTestParametersForFormatsSyncModesAndPartitioning")
public void testVariousOperations(
String sourceTableFormat, SyncMode syncMode, boolean isPartitioned) {
// Disable the lock manager and heartbeat threads for both Catalog and Table configurations

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lock-impl/heartbeat disabling looks unrelated to a per-table sync timeout. Is it masking the executor/heartbeat thread leak from the RunSync change (e.g. the IT not terminating)? Please split it into its own PR or explain the connection in the description — keeping this PR scoped to the timeout feature makes it easier to review and revert.

@sapienza88 sapienza88 Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prior to adding those Iceberg configs, I had this CI error:

Error: Tests run: 45, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 886.7 s <<< FAILURE! -- in org.apache.xtable.ITConversionController

Error: org.apache.xtable.ITConversionController.testVariousOperations(String, SyncMode, boolean)[9] -- Time elapsed: 46.59 s <<< ERROR!

java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@103e0cca[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@350a7db8[Wrapped task = org.apache.iceberg.util.LockManagers$InMemoryLockManager$$Lambda$4325/0x000000010186d040@4b35e84a]] rejected from java.util.concurrent.ScheduledThreadPoolExecutor@53e4a92a[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 21]

at java.base/java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2055)

at java.base/java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:825)

at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:340)

at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(ScheduledThreadPoolExecutor.java:632)

at java.base/java.util.concurrent.Executors$DelegatedScheduledExecutorService.scheduleAtFixedRate(Executors.java:785)

at org.apache.iceberg.util.LockManagers$InMemoryLockManager.acquireOnce(LockManagers.java:220)

at org.apache.iceberg.util.LockManagers$InMemoryLockManager.lambda$acquire$1(LockManagers.java:249)

at org.apache.iceberg.util.Tasks$Builder.runTaskWithRetry(Tasks.java:413)

at org.apache.iceberg.util.Tasks$Builder.runSingleThreaded(Tasks.java:219)

at org.apache.iceberg.util.Tasks$Builder.run(Tasks.java:203)

at org.apache.iceberg.util.Tasks$Builder.run(Tasks.java:196)

at org.apache.iceberg.util.LockManagers$InMemoryLockManager.acquire(LockManagers.java:249)

at org.apache.iceberg.hadoop.HadoopTableOperations.renameToFinal(HadoopTableOperations.java:363)

at org.apache.iceberg.hadoop.HadoopTableOperations.commit(HadoopTableOperations.java:162)

at org.apache.iceberg.SnapshotProducer.lambda$commit$2(SnapshotProducer.java:465)

at org.apache.iceberg.util.Tasks$Builder.runTaskWithRetry(Tasks.java:413)

at org.apache.iceberg.util.Tasks$Builder.runSingleThreaded(Tasks.java:219)

at org.apache.iceberg.util.Tasks$Builder.run(Tasks.java:203)

at org.apache.iceberg.util.Tasks$Builder.run(Tasks.java:196)

at org.apache.iceberg.SnapshotProducer.commit(SnapshotProducer.java:437)

at org.apache.iceberg.StreamingDelete.commit(StreamingDelete.java:24)

at org.apache.xtable.TestIcebergTable.deletePartition(TestIcebergTable.java:241)

at org.apache.xtable.TestIcebergTable.deleteSpecialPartition(TestIcebergTable.java:246)

at org.apache.xtable.ITConversionController.testVariousOperations(ITConversionController.java:294)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)

at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)

at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)

at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)

at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vinishjail97 all reviewing comments were addressed here.

Selim Soufargi added 2 commits June 5, 2026 21:15
… submit() instead of delayer and runAsync + cancel(true), shutdown executor in finally

@the-other-tim-brown the-other-tim-brown left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure to fill out the PR description following the guidelines.

HudiSourceConfig.PARTITION_FIELD_SPEC_CONFIG, table.getPartitionSpec());
}
// use a single-thread executor since tasks are processed sequentially
java.util.concurrent.ExecutorService syncExecutor = Executors.newSingleThreadExecutor();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets make sure to use imports over fully qualified names throughout this PR.

Selim Soufargi added 2 commits July 7, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants