You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "DanielLeens (via GitHub)" <gi...@apache.org> on 2026/09/22 14:23:54 UTC

[PR] [Test][E2E] Bound Flink E2E jobs and capture JVM thread dumps when one hangs [seatunnel]

DanielLeens opened a new pull request, #12446:
URL: https://github.com/apache/seatunnel/pull/12446

   ### Purpose of this pull request
   
   `kudu-connector-it` is being cancelled by its 90-minute `timeout-minutes` on PRs that do not touch Kudu (eight PRs updated in the last two days: #12394, #12137, #11727, #11077, #11545, ... on both JDK legs) and on `dev` push run 35625308814 (JDK 11), while its green runs take about 30 minutes. This is a hang, not growth, and this PR makes the next occurrence diagnosable instead of silent. It does **not** fix the hang.
   
   ### What the logs show
   
   Both cancellations I inspected hang in `KuduIT.testKuduWholeDatabaseRead`, on different Flink versions (`dev` on Flink 1.18.0, #12394 on Flink 1.15.3, where it was the very first job on a freshly started container):
   
   1. The client submits `kudu_to_assert_with_all_tables.conf`; the JobManager logs `Starting split enumerator`, `switched from state CREATED to RUNNING`, `Deploying Source: Kudu-Source ...` and then **logs nothing else for the job**.
   2. The TaskManager receives the task, starts `BlobClient Downloading ... from jobmanager/172.18.0.5:6124`, and ten seconds later logs `Slot offering to JobManager did not finish in time. Retrying the slot offering.` The BLOB download later fails with `GET operation failed: Read timed out`.
   3. Two minutes after submission the ResourceManager (same JVM as the JobMaster) logs `The heartbeat of JobManager with id ... timed out` and the TaskManager fails the task with `Disconnect from JobManager responsible for ...`.
   4. For the remaining ~80 minutes the TaskManager loops `Could not resolve JobManager address pekko.tcp://flink@jobmanager:6123/user/rpc/jobmanager_N`, the ResourceManager loops `Missing resources: Job ... numberOfRequiredSlots=1`, and the SeaTunnel client inside the JobManager container waits forever, until the workflow cancels the job and the containers are destroyed.
   
   So the JobMaster RPC endpoint and the BlobServer both stop responding right after the first deployment, while the ResourceManager in the same JVM keeps running. Nothing SeaTunnel runs on the JobMaster main thread: `FlinkSourceEnumerator.start()`/`addReader()` (and through them `KuduSourceSplitEnumerator.open()`/`run()`, which create the Kudu client and build scan tokens) execute on Flink's SourceCoordinator thread. Which thread is actually stuck can only be answered by a thread dump of the JobManager JVM, and none exists because the cancellation happens first.
   
   ### Change (test infrastructure only)
   
   `AbstractTestFlinkContainer#executeJob(String, List<String>)`:
   
   - runs the job submission on a daemon thread and waits at most 30 minutes for it;
   - on timeout, sends `SIGQUIT` to every JVM in the JobManager and TaskManager containers (found through `/proc`, since the Flink images ship neither `pgrep` nor `jstack`/`jcmd`), waits five seconds so HotSpot can print the dumps to the containers' stdout, which testcontainers already forwards into the test log, and then fails the test with a message pointing at them;
   - rethrows `IOException`/`InterruptedException`/`RuntimeException` from the submission unchanged, so every existing caller sees the same exceptions as before.
   
   `executeJob(String)` delegates to this method, so both Flink entry points are covered; `savepointJob`, `cancelJob` and `restoreJob` are untouched. Green jobs are unaffected: no Flink E2E job legitimately runs anywhere near 30 minutes (the longest whole IT class in `jdbc-connectors-it-part-1` is 25 minutes across all containers). A hung Kudu job now fails after 30 minutes with thread dumps instead of being cancelled after 90 minutes with nothing.
   
   ### Files
   
   - `seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/flink/AbstractTestFlinkContainer.java`
   
   ### How was this patch tested?
   
   Test-infrastructure-only change; verified by this PR's GitHub CI (the Flink E2E jobs exercise the new path on every green job). Local checks were limited to `./mvnw spotless:apply -pl seatunnel-e2e/seatunnel-e2e-common`. The timeout branch itself is only exercised by a real hang; the next `kudu-connector-it` cancellation on `dev` will show whether the dumps land in the log.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Test][E2E] Bound Flink E2E jobs and capture JVM thread dumps when one hangs [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #12446:
URL: https://github.com/apache/seatunnel/pull/12446#issuecomment-6557762585

   The CI fact in my [existing full review of this exact head](https://github.com/apache/seatunnel/pull/12446#pullrequestreview-5721276778) has changed. That source review is already published; this is a gate clarification, not another full source review on the same version.
   
   Source status: the existing review found no blocking source issue. Its non-blocking suggestions are unchanged.
   
   The [exact-head fork Build](https://github.com/DanielLeens/seatunnel/actions/runs/41162470372) is now `completed` / `cancelled`, attempt 1. Job conclusions: success=84, cancelled=1, skipped=11. Cancelled targets include [Run / connector-file-local-it (11, ubuntu-latest)](https://github.com/DanielLeens/seatunnel/actions/runs/41162470372/job/124440264361). The evidence does not identify why the workflow was cancelled; cancellation alone does not establish a source fix in dev. The run owner should check for a newer active attempt, then resume only the cancelled required jobs. Do not introduce unrelated source/dependency edits or assume branch synchronization repairs cancellation.
   
   The current base comparison is recorded separately. Missing Apache check adoption is distinct from the fork conclusion, and neither is an effective independent approval. Daniel is the author and has READ repository permission.
   
   Checked 2026-11-01T12:11:46.916415+00:00; unchanged head `d8f644bf6e7b5fc6b89da821a76f9cf9bbec0fd0`, base `dev`; compare `diverged`, ahead 6 / behind 9; merge `blocked` / `BLOCKED`; review decision `REVIEW_REQUIRED`. Behind/diverged is recorded independently and does not itself request a sync. Daniel has READ repository permission.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Test][E2E] Bound Flink E2E jobs and capture JVM thread dumps when one hangs [seatunnel]

Posted by "davidzollo (via GitHub) via commits" <co...@seatunnel.apache.org>.
davidzollo merged PR #12446:
URL: https://github.com/apache/seatunnel/pull/12446


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Test][E2E] Bound Flink E2E jobs and capture JVM thread dumps when one hangs [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #12446:
URL: https://github.com/apache/seatunnel/pull/12446#issuecomment-6646623331

   The CI fact cited previously has changed: exact-head fork Build 41162470372 is now successful, so the instruction to resume the cancelled connector-file-local-it JDK 11 lane is obsolete. My existing source conclusion remains clear. Apache still has no adopted current-head check, so check adoption and independent maintainer approval remain separate gates. No additional source patch or drift-only sync is requested; as author I cannot independently approve this PR.
   
   This is an unchanged-head CI/merge clarification, not another full source review. No local runtime testing was performed. Daniel has READ permission; effective maintainer approval/dismissal remains separate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Test][E2E] Bound Flink E2E jobs and capture JVM thread dumps when one hangs [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #12446:
URL: https://github.com/apache/seatunnel/pull/12446#issuecomment-7037737366

   Thanks, @davidzollo, for the independent approval. The exact-head Build remains successful, and my existing source conclusion is unchanged. As the PR author I cannot independently approve my own change. The remaining repository review/merge controls belong to a write-capable maintainer; no new code patch is requested here.
   
   Checked unchanged head `d8f644bf6e7b5fc6b89da821a76f9cf9bbec0fd0` against `dev`: compare `diverged`, ahead 6 / behind 122. This drift is recorded independently; it does not by itself request synchronization. This is a discussion/CI follow-up, not another full source review. No local build, test or runtime execution was performed. Daniel has READ repository permission; effective maintainer approval/dismissal remains a separate repository gate. Checked 2026-11-20T11:54:15.110727+00:00.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Test][E2E] Bound Flink E2E jobs and capture JVM thread dumps when one hangs [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #12446:
URL: https://github.com/apache/seatunnel/pull/12446#issuecomment-6538142026

   Addressed both blocking items from the 2026-10-22 review and synced with `dev`. New head: `d8f644bf6e7b5fc6b89da821a76f9cf9bbec0fd0` (commit [d8f644b](https://github.com/apache/seatunnel/pull/12446/commits/d8f644bf6e7b5fc6b89da821a76f9cf9bbec0fd0) on top of merge `fb853fb` of `origin/dev` `3ac2d1cec6a`, which brings in #12756 and #12848; the merge had no conflicts).
   
   **Issue 1 - timeout diagnostics have no host-side deadline** (`AbstractTestFlinkContainer.java`)
   - Each thread dump request now runs on its own daemon thread and is waited for at most `THREAD_DUMP_TIMEOUT_SECONDS` = 60 s on the host (`AbstractTestFlinkContainer.java:225` constant with the rationale, `:302-332` `dumpJvmThreads`). A request that misses the deadline is logged and abandoned, `dump.cancel(true)` + `shutdownNow()` run in `finally` (`:329-330`), and the next role is still attempted (`:251-252`), so a stalled Docker exec can no longer block past the job deadline or hide the second dump. Timeouts and dump failures are only logged; the original `IllegalStateException` for the job timeout is always thrown. Worst-case host-side bound is therefore 30 min + 2 x 60 s. Container teardown remains the cleanup boundary for the remote processes; the Javadoc says so explicitly.
   - The daemon-executor construction is shared by the job wait and the dump requests via `newDaemonExecutor` (`:338`).
   
   **Issue 2 - no deterministic coverage of the timeout/diagnostic path** (`AbstractTestFlinkContainerTest.java`)
   - The job and dump deadlines are exposed as package-private getters `getJobTimeout()` / `getThreadDumpTimeout()` (`AbstractTestFlinkContainer.java:285-295`); production values are unchanged (30 min / 60 s), the existing `TestFlinkContainer` in the test overrides them to 200 ms and stubs the submission (`AbstractTestFlinkContainerTest.java:243-288`).
   - `shouldFailAfterJobDeadlineAndBoundEachThreadDumpRequest` (`:144`): job never returns, JobManager dump request blocks forever, TaskManager dump request throws. Asserts under a 10 s preemptive budget that `executeJob` throws `IllegalStateException` caused by `TimeoutException`, and that both containers received the `kill -QUIT` exec. It fails if the job deadline is removed, if the stalled dump is not bounded on the host (the call would exceed the budget), if the second dump is skipped after the first stalled, or if the dump failure replaces the timeout exception.
   - `shouldReturnJobResultWithoutThreadDumpsWhenJobFinishesInTime` (`:188`): same `ExecResult` instance is returned and no dump exec is issued.
   - `shouldRethrowJobFailureUnchanged` (`:208`): an `IOException` from the submission is rethrown as the same instance (guards the `ExecutionException` unwrapping), no dump exec is issued.
   
   Local checks were limited to `./mvnw spotless:apply` / `spotless:check` on `seatunnel-e2e/seatunnel-e2e-common` (both clean); compile and tests are left to CI per the validation policy. Fork Build run for the new head: https://github.com/DanielLeens/seatunnel/actions/runs/41162470372 (queued at the time of writing).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org