You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "SEPURI-SAI-KRISHNA (via GitHub)" <gi...@apache.org> on 2026/09/22 08:38:05 UTC

[PR] [Improve][Connector-V2] Correct two RocketMQ comments that no longer hold [seatunnel]

SEPURI-SAI-KRISHNA opened a new pull request, #12438:
URL: https://github.com/apache/seatunnel/pull/12438

   ### Purpose of this pull request
   
   Two comments in the RocketMQ connector no longer describe the code around them. Both are mine, and both went stale when the PRs they referenced merged. This corrects them and changes nothing else.
   
   **1. `RocketMqAdminUtil.currentOffsets` overstates its own invariant.**
   
   The comment at the `TOPIC_NOT_EXIST` early return says the accumulated map "is necessarily still empty here". @DanielLeens flagged on #12417 that the invariant does not establish that, and he is right. Each loop iteration calls `examineConsumeStats` again, which re-resolves the group's retry topic. A retry topic that resolved on an earlier iteration and has gone by a later one would reach this return with offsets already collected for the earlier topics.
   
   The rewritten comment keeps the invariant and the existing guidance that the `return` has to become a `continue` if that ever becomes reachable, and names the transition it does not cover instead of claiming there is none.
   
   **2. `RocketMqIT` describes #12349 as unmerged.**
   
   The comment reads:
   
   > On dev `currentOffsets` still maps a failed lookup onto an empty map, so today this is a consistency fix; it becomes load bearing once #12349 makes that call raise `RocketMqConnectorException`
   
   #12349 merged on 2026-09-21. Both halves are now false: `currentOffsets` already raises, and the retry predicate is already load bearing rather than a consistency fix. Rewritten in the present tense.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Comments only. Both files are byte-identical to `dev` once `//` comments and blank lines are stripped:
   
   ```
   diff -B <(strip dev/RocketMqAdminUtil.java) <(strip RocketMqAdminUtil.java)   # empty
   diff -B <(strip dev/RocketMqIT.java)        <(strip RocketMqIT.java)          # empty
   ```
   
   ### How was this patch tested?
   
   ```
   ./mvnw -pl seatunnel-connectors-v2/connector-rocketmq test
   Tests run: 24, Failures: 0, Errors: 0, Skipped: 0
   ```
   
   `spotless:check` is green, and `connector-rocketmq-e2e` test-compiles. The container-backed `RocketMqIT` was not run locally, since Docker is not available in my environment, but the change to that file is a comment.
   
   ### Note on overlapping work
   
   #12350 also touches `RocketMqIT.java`. Its hunks run from line 487 to 651 and do not include the comment changed here, so there is no textual overlap.
   


-- 
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] [Improve][Connector-V2] Correct two RocketMQ comments that no longer hold [seatunnel]

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


-- 
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] [Improve][Connector-V2] Correct two RocketMQ comments that no longer hold [seatunnel]

Posted by "SEPURI-SAI-KRISHNA (via GitHub)" <gi...@apache.org>.
SEPURI-SAI-KRISHNA commented on PR #12438:
URL: https://github.com/apache/seatunnel/pull/12438#issuecomment-5904594131

   Thanks @SEZ9. Re-posting the clipped paragraph in full, and it is now out of date in the best way, so here is the current state instead of just the text you were missing.
   
   What the clipped paragraph said: the run that was red on this head was void rather than failing. `Code style` died at 4m58s before Spotless ever ran, because the Maven wrapper jar download from `repo.maven.apache.org` returned HTTP 429 on five consecutive retries and the job ended in `Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain`. That gated 52 downstream jobs. I said I was rerunning it and that `spotless:check` was clean locally on both modules.
   
   That rerun has since finished and it is green. Attempt 2 of run `36437331456` on unchanged head `5cc724b9342` completed at 03:19:06 UTC on September 29 with conclusion `success`: 28 jobs successful, 40 skipped, 0 failed. The upstream `Build` check on this PR is passing, alongside `labeler` and `Notify test workflow`. So all three checks are green and there is no red badge left to explain.
   
   Nothing changed in the diff to get there. The head is still `5cc724b9342`, the blobs are still `03ecf079` for `RocketMqAdminUtil.java` and `7fc989a0` for `RocketMqIT.java`, and attempt 2 was a rerun of the same commit rather than a new push. So the diff you are about to read at `5cc724b9342` is the one that produced this green run.
   
   On your two findings, reading them at the current head is the right call and I am not asking you to take my quotes for it. Two greps that may save you a pass:
   
   For PR12438-F1, the string "unreachable" appears zero times in `RocketMqAdminUtil.java` at this head. The word "reachable" appears exactly once, at line 350, inside "The invariant does not cover one transition, and that transition is reachable today", which asserts the transition is reachable rather than denying it.
   
   For PR12438-F2, `RocketMqIT.java` at this head contains zero matches for `#[0-9][0-9][0-9][0-9]`, so no PR number anywhere in the file, and the comment at lines 535-540 has no past-tense narration of the previous code. One caveat so the grep does not surprise you: line 604 does say "previously had", but that is a pre-existing comment about the topic's queue count, it is on `dev` unchanged at line 603, and it is outside this diff.
   
   Nothing else outstanding from my side.
   


-- 
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] [Improve][Connector-V2] Correct two RocketMQ comments that no longer hold [seatunnel]

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

   Thanks for coming back to correct this rather than leaving the earlier pointer standing — that is exactly the right instinct, and the 50-run comparison table makes the distinction clear: #12381 widens a wait that was never the actual bottleneck, while #12444 removes the real race by releasing the latch before the body write. That matches what I traced independently when I looked at `PayPalClient.execute()` and the test server's `arrived.countDown()` ordering.
   
   This PR's own diff is still just two comment corrections with no code path to `connector-http-paypal`, so my APPROVED review stands — the remaining red `Build` leg is confirmed unrelated to this change and should clear once #12444 merges.


-- 
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] [Improve][Connector-V2] Correct two RocketMQ comments that no longer hold [seatunnel]

Posted by "SEPURI-SAI-KRISHNA (via GitHub)" <gi...@apache.org>.
SEPURI-SAI-KRISHNA commented on PR #12438:
URL: https://github.com/apache/seatunnel/pull/12438#issuecomment-5882867817

   Thanks @SEZ9, and agreed on keeping the `continue` change out. I will file the issue and the PR for it once this lands, with the two-topic `RocketMqAdminUtilTest` case where the first topic returns stats and the second raises `TOPIC_NOT_EXIST` with the route available, so the earlier topic's offsets have to survive.
   
   On the truncation: the comment posted in full on my side, 500 words, and the sentence you saw cut is complete in it:
   
   > A comment anchored on a PR number and on what the code used to be is the same pattern that went stale and created this PR, so I dropped the history rather than updating it.
   
   So nothing is missing, and there was no further content beyond what you already read. Something in between clipped it.
   
   One thing worth flagging before you check the diff: **the head has moved from `533cfde8` to `5cc724b9342`**. That is only a merge of current `dev`, taken to pick up #12444, which fixes the `PayPalClientTest` Windows flake that was reddening this PR. The two files you are reviewing are byte-identical across the two heads:
   
   | file | blob at `533cfde8` | blob at `5cc724b9342` |
   | --- | --- | --- |
   | `RocketMqAdminUtil.java` | `03ecf079` | `03ecf079` |
   | `RocketMqIT.java` | `7fc989a0` | `7fc989a0` |
   
   So reviewing at either head gives the same text, and the diff is still comment-only: stripping comments leaves both files identical to `dev`.
   
   On the two points you said you would verify, both hold at the current head:
   
   - `RocketMqIT.java:535-540` no longer references a PR number and no longer narrates what the code used to be. It reads: "currentOffsets raises RocketMqConnectorException when the lookup itself fails, and returns an empty map only when the group has legitimately committed nothing, so matching that exception here retries transient metadata failures without masking a genuine cold start. The empty-map case is what the getMinOffset() fallback below covers."
   - `RocketMqAdminUtil.java:349-359` names the consequence as a full rewind: "The caller reads an empty map as a cold start and rewinds every topic to its first offset, so supporting that layout means turning this into a continue that keeps the earlier offsets." That matches the `if (groupOffsets.isEmpty()) { listOffsets(queues, CONSUME_FROM_FIRST_OFFSET) }` at `RocketMqSourceSplitEnumerator.java:380-383`.
   
   CI note so the red badge does not hold this up: the run on the current head is void rather than failing. `Code style` died at 4m58s before Spotless ever ran, because the Maven wrapper jar download from `repo.maven.apache.org` returned HTTP 429 on five consecutive retries and the job ended in `Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain`. That gated 52 jobs. I am rerunning it; `spotless:check` is clean locally on both modules.
   


-- 
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] [Improve][Connector-V2] Correct two RocketMQ comments that no longer hold [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12438:
URL: https://github.com/apache/seatunnel/pull/12438#issuecomment-5923276975

   Thanks for re-posting the clipped paragraph in full, @SEPURI-SAI-KRISHNA, and for the update that the head is still `5cc724b9342` with the same blobs (`03ecf079` for `RocketMqAdminUtil.java`, `7fc989a0` for `RocketMqIT.java`) and that attempt 2 of run `36437331456` was a rerun of that commit rather than a new push.
   
   On the two findings, the wording you quoted is the direction I was asking for:
   
   - **PR12438-F1** – asserting that the transition is reachable and naming the full-rewind consequence at `RocketMqAdminUtil.java:349-359` is exactly what the earlier comment was missing.
   - **PR12438-F2** – dropping the PR-number anchor and the past-tense narration at `RocketMqIT.java:535-540`, and separating the exception case from the legitimately-empty-map case, addresses the imprecision I flagged. Noted on the pre-existing "previously had" comment being unchanged from `dev` and outside this diff; I am not asking you to touch it here.
   
   I still need to read both passages at `5cc724b9342` myself before closing either finding, so I will hold off on marking them resolved until I have done that read-through and will follow up here with the result.
   
   <!-- streview-comment:1432 -->


-- 
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] [Improve][Connector-V2] Correct two RocketMQ comments that no longer hold [seatunnel]

Posted by "SEPURI-SAI-KRISHNA (via GitHub)" <gi...@apache.org>.
SEPURI-SAI-KRISHNA commented on PR #12438:
URL: https://github.com/apache/seatunnel/pull/12438#issuecomment-5781946322

   The red badge here is not reachable from this diff, and rerunning it is not going to clear it.
   
   One leg fails, `unit-test (11, windows-latest)`, on a test in a connector this PR does not touch:
   
   ```
   PayPalClientTest.closeWakesRetryWait:416 expected: <true> but was: <false>
   ```
   
   This PR changes two comment lines in `connector-rocketmq` and `connector-rocketmq-e2e` and shares no code with `connector-http-paypal`. On that same failing leg the RocketMQ modules were green, including `RocketMqAdminUtilTest` at 6 of 6.
   
   I reran it once and it failed again, so I stopped rather than keep rolling. Measured across three of my PRs on 09-21 and 09-22, that leg fails on this exact assertion in 4 of 6 attempts, which is a two-thirds failure rate rather than an occasional flake. The details are on #12381, which is the open fix: it gives the arrival wait its own 60 second budget while leaving the bounds that test client behaviour at 15 seconds, so a genuine hang still fails fast. It has had @DanielLeens's approval since 09-18 and the diff has not changed since.
   
   So there are two ways forward and I am happy with either. Merging #12381 first fixes this for everyone and this PR goes green on its own. Otherwise this one can be taken with the red leg, since the failure is in another module and the diff here is comment-only: both files are byte-identical to `dev` once comments are stripped.
   


-- 
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] [Improve][Connector-V2] Correct two RocketMQ comments that no longer hold [seatunnel]

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

   @/tmp/reply_body_12438.md


-- 
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] [Improve][Connector-V2] Correct two RocketMQ comments that no longer hold [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12438:
URL: https://github.com/apache/seatunnel/pull/12438#issuecomment-5902663207

   Thanks @SEPURI-SAI-KRISHNA for the follow-up.
   
   On the `continue` change: agreed on keeping it out of this PR. The two-topic `RocketMqAdminUtilTest` case you describe (first topic returns stats, second raises `TOPIC_NOT_EXIST` with the route available, earlier offsets must survive) is the shape I had in mind for the follow-up, so nothing further from me on that here.
   
   On the truncation: thanks for re-posting the sentence. With it in full, the reasoning for dropping the history from the `RocketMqIT` comment is clear.
   
   On the head move `533cfde8` -> `5cc724b9342`: noted, and the blob table (`03ecf079` for `RocketMqAdminUtil.java`, `7fc989a0` for `RocketMqIT.java`) is helpful. I will still re-check the diff at `5cc724b9342` myself rather than carry my earlier read forward.
   
   On the two findings, the wording you quoted looks like it addresses both, but I want to confirm against the diff before marking either resolved:
   
   - PR12438-F1 (`RocketMqAdminUtil.java:349-359`): the quoted sentence names the consequence concretely (empty map read as a cold start, every topic rewound to its first offset, `continue` as the way to keep earlier offsets) and no longer frames the branch as unreachable. I will read blob `03ecf079` in context to confirm nothing around it still says "unreachable", and mark it resolved once that checks out.
   - PR12438-F2 (`RocketMqIT.java:535-540`): the quoted text has no PR number, no narration of what the code used to be, and ties the empty-map case to the `getMinOffset()` fallback. I will confirm the same against blob `7fc989a0` at the current head.
   
   One small thing: your latest comment appears clipped on my end again, ending mid-sentence at "because the Maven wra". Could you re-post the rest of that paragraph?
   
   Once the diff check above is done, I expect to have nothing else outstanding on this PR.
   
   <!-- streview-comment:1409 -->


-- 
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] [Improve][Connector-V2] Correct two RocketMQ comments that no longer hold [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #12438:
URL: https://github.com/apache/seatunnel/pull/12438#issuecomment-5882382008

   @SEPURI-SAI-KRISHNA thanks for re-checking the reachability argument against `topicRouteAvailable` and the `groupOffsets.isEmpty()` fallback rather than just taking the wording. The paragraph you quoted for Issue 1 reads correctly to me: it states the transition is reachable on a multi-broker layout, explains why the guard does not cover it, and names the consequence (empty map read as a cold start, full rewind) and the fix direction (a `continue` that keeps the earlier offsets). I will confirm that text against the `RocketMqAdminUtil.java` comment at the current head (533cfde8) before marking PR12438-F1 resolved, but I do not expect any further changes.
   
   On the `continue` change plus the two-topic `RocketMqAdminUtilTest` case: keep it out of this PR. Your reasoning is right that this PR is comment-only and that change alters production behaviour on a replay-hazard path, so a separate issue and PR after this lands is the right shape. No need to close and refile a combined one.
   
   On Issue 2 (PR12438-F2): your comment appears to have been cut off partway through "the same pattern that we", so I only see that you agreed with the stronger version. No need to paste the wording here; I will check the `RocketMqIT` comment in the diff at the current head and confirm it no longer references the PR number or narrates what the code used to be, and that it describes an empty map as a full rewind of every topic, matching the `if (groupOffsets.isEmpty()) { listOffsets(queues, CONSUME_FROM_FIRST_OFFSET) }` behaviour you cited. If the truncated part of your comment contained anything beyond that, feel free to add it.
   
   Assuming the diff matches, I expect this is good to go.
   
   <!-- streview-comment:1386 -->


-- 
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] [Improve][Connector-V2] Correct two RocketMQ comments that no longer hold [seatunnel]

Posted by "SEPURI-SAI-KRISHNA (via GitHub)" <gi...@apache.org>.
SEPURI-SAI-KRISHNA commented on PR #12438:
URL: https://github.com/apache/seatunnel/pull/12438#issuecomment-5865774547

   Thanks @SEZ9, both findings are right and I have taken both.
   
   **Issue 1.** You are correct that the wording contradicted itself. It said the transition "would reach this return with offsets already collected" and then hedged with "If that ever becomes reachable". I checked the mechanism against the code rather than just accepting the wording was awkward, and the reachability argument holds:
   
   - `topicRouteAvailable(adminClient, topic)` at `RocketMqAdminUtil.java:388-397` calls `examineTopicRouteInfo(topic)` on the **requested** topic. It never probes the group's retry topic, so the Javadoc's per-broker argument only holds when the two live on the same broker.
   - `RocketMqSourceSplitEnumerator.java:380-383` is `if (groupOffsets.isEmpty()) { listOffsets(queues, CONSUME_FROM_FIRST_OFFSET) }`, so an empty map is a full rewind of every topic, exactly as you describe.
   
   So on a multi-broker layout the discard is reachable and the replay hazard is real. The comment now says that plainly instead of hedging:
   
   > The invariant does not cover one transition, and that transition is reachable today. The guard above probes the requested topic, not the group's retry topic, and every iteration re-resolves the retry topic. On a multi-broker cluster where the retry topic and a later topic in the list are hosted on different brokers, losing the retry topic's broker mid-loop leaves the later topic resolvable, so the guard passes and this return discards the offsets already collected for the earlier topics. The caller reads an empty map as a cold start and rewinds every topic to its first offset, so supporting that layout means turning this into a continue that keeps the earlier offsets.
   
   On actually making it a `continue` plus the two-topic `RocketMqAdminUtilTest` case: I would rather not fold that in here. This PR is comment-only by construction (stripping comments leaves it byte-identical to `dev`), and that change alters production behaviour on a path with a replay hazard, so it deserves its own PR, its own issue and a reviewer looking at the behaviour rather than at wording. I am happy to open it right after this lands, with the two-topic mock next to `testCurrentOffsets_multipleTopicsAreMergedAcrossTheLoop` as you specified. If you would rather see them together, say so and I will close this and file the combined one instead.
   
   **Issue 2.** Agreed, and agreed on the stronger version. A comment anchored on a PR number and on what the code used to be is the same pattern that went stale and created this PR, so I dropped the history rather than updating it. You are also right that "instead of returning an empty map" was imprecise: the cold-start branch at `RocketMqAdminUtil.java:361` still returns `Collections.emptyMap()`, and the `getMinOffset()` fallback at `RocketMqIT.java:557-559` depends on it. The comment now states only the present contract and points at that fallback:
   
   > currentOffsets raises RocketMqConnectorException when the lookup itself fails, and returns an empty map only when the group has legitimately committed nothing, so matching that exception here retries transient metadata failures without masking a genuine cold start. The empty-map case is what the getMinOffset() fallback below covers.
   
   Still comment-only, no behaviour change.
   


-- 
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] [Improve][Connector-V2] Correct two RocketMQ comments that no longer hold [seatunnel]

Posted by "SEPURI-SAI-KRISHNA (via GitHub)" <gi...@apache.org>.
SEPURI-SAI-KRISHNA commented on PR #12438:
URL: https://github.com/apache/seatunnel/pull/12438#issuecomment-5852890690

   Correcting my comment above. I wrote that "merging #12381 first fixes this for everyone and this PR goes green on its own". That is wrong, and I would rather say so than leave a bad pointer on a PR waiting for a merge decision.
   
   #12381 widens the arrival wait from 15s to 60s. But the failure is not a wait that runs out, it is a latch that never fires. @SEZ9 traced it on that thread and @DanielLeens confirmed it against the source: `PayPalClient.execute()` returns on a transient status without reading the entity, then aborts the request in its `finally`, while the test server only calls `arrived.countDown()` after `exchange.getResponseBody().write(...)` succeeds, inside a `catch (IOException ignored)`. `closeWakesRetryWait` replies with a plain 503, so it takes exactly that path: if the abort wins the race the write throws, the exception is swallowed, and nothing ever counts the latch down. No budget fixes that.
   
   @goutamadwant then measured it, 50 runs per variant:
   
   | variant | normal | with the body write forced to throw |
   |---|---|---|
   | dev | 5 of 50 fail | |
   | #12381 | 1 of 50 fail, after the full 60s | 20 of 20 fail |
   | #12444 | 0 of 50 | 0 of 20 |
   
   So the PR that actually clears this red leg is **#12444**, not #12381. It releases the latch before the body write and adds a `finally` safety net, which is the root cause rather than a wider ceiling. #12381 is now marked changes-requested.
   
   Nothing on this PR changes: still two comment lines, still byte-identical to `dev` once comments are stripped, still no code path to `connector-http-paypal`. The options are the same as before, only the first one now names the right PR: merge #12444 first and this goes green, or take this with the known-unrelated red leg.
   


-- 
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