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/19 04:38:09 UTC

[PR] [Fix][E2E] Retry and route-guard the remaining RocketMqIT offset reads [seatunnel]

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

   ### Purpose of this pull request
   
   This is the follow-up I committed to on #12323, which fixes the two remaining gaps I found while sweeping that file and deliberately kept out of that PR to keep its scope tight. Both were listed there as points 2 and 3, and @DanielLeens recorded them as non-blocking in his review.
   
   **`currentOffsets` was not retry-wrapped while its neighbour was.** In `getRocketMqConsumerData`, the `offsetTopics` lookup is wrapped in `RetryUtils.retryWithException`, and the `currentOffsets` call immediately below it was not, although both read broker metadata that can be briefly unavailable. They now use the same `RetryMaterial`.
   
   This matters more since #12349. There, `RocketMqAdminUtil.currentOffsets` stops reporting a failed lookup as an empty map and surfaces it as `RocketMqConnectorException` instead. That is the right behaviour for the production caller, but it means an unwrapped call here fails the test where the wrapped neighbour one line up would have retried. The `RetryMaterial` already in place retries exactly `exception instanceof RocketMqConnectorException`, so this is the consistent spelling rather than a new policy.
   
   **`checkOffsetNoDiff` has the tightest window in the file.** It reads `offsetTopics` and then `currentOffsets` under `Awaitility` with a 30 second ceiling. Every other window in this file is 60 seconds or longer, up to 5 minutes, and while working on #12322 I measured a name server route gap that lasted 4 minutes 24 seconds. A gap of that size fails this check.
   
   The fix confirms the route before entering the window rather than widening it, using the `waitForTopicRoute` helper already in the file. That follows the approach #12323 established, and keeps the assertion window itself tight so a genuine offset mismatch still fails fast.
   
   I want to be precise about the evidence for each, as I was on #12323.
   
   The `checkOffsetNoDiff` window is latent rather than demonstrated: `testSourceRocketMqTextToConsoleWithOffsetCheck` did not fail once across the 12 daily `Schedule Backend` runs I sampled for #12322. That is why it was not folded into #12323.
   
   The `currentOffsets` call has been seen failing tests, but I do not want to claim it as evidence for a retry, because it is not. On the first commit of #12349, before that PR was corrected, `testSinkRocketMq` failed 7 of 7 at `getRocketMqConsumerData` with `ROCKETMQ-09`. The cause there was the never-created `%RETRY%` topic, which is a standing condition rather than a transient one, so a retry would only have delayed the same failure. #12349 fixes that cause directly. What this change covers is the genuinely transient case, and that has not been separately demonstrated on this call. It is a consistency fix with a plausible benefit, not a fix for an observed failure.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Test-only, in a single E2E class. No production code, config option, or documented behaviour is touched.
   
   ### How was this patch tested?
   
   `./mvnw -q -DskipTests verify -pl seatunnel-e2e/seatunnel-connector-v2-e2e/connector-rocketmq-e2e` on JDK 11 passes, which covers the enforcer checks, `spotless:check` and compilation. `spotless:check` was also run separately with up-to-date caching disabled.
   
   No new test is added, and this is the case the test-class convention is about: the change is to `RocketMqIT` itself, so the IT is both the thing being changed and the coverage. The `rocketmq-connector-it` legs on this PR's own CI exercise both paths: `getRocketMqConsumerData` is reached from `testSinkRocketMq`, `testTextFormatSinkRocketMq` and `testSinkRocketMqMessageTag`, and `checkOffsetNoDiff` from `testSourceRocketMqTextToConsoleWithOffsetCheck`.
   


-- 
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] [Fix][E2E] Retry and route-guard the remaining RocketMqIT offset reads [seatunnel]

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

   @nzw921rx heads up on an overlap: this PR and your #12350 both edit `RocketMqIT.java`, so whichever lands second will need a rebase.
   
   This one is +30/-5 on that file, approved, CI green. #12350 is +51/-59 and currently conflicts with `dev`, probably from #12323, #12393 and #12396 landing in that file after it was opened. The two do not overlap in intent, since this change only wraps the remaining offset reads in the retry and route guard that are already in the file. If you would rather land #12350 first, I will rebase this on top of it and re-verify.
   
   #12349 is the same area and in the same state, approved and green, open since 09-16. It is the production fix behind #12332, and SEZ9 confirmed on 09-20 that nothing further is needed there.
   


-- 
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] [Fix][E2E] Retry and route-guard the remaining RocketMqIT offset reads [seatunnel]

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

   All four addressed. Thank you for these, particularly Issue 3, which is my own finding from #12332 applied back to my own change and I did not spot it.
   
   **Issue 1.** `shouldThrowException` is now `true` on the `currentOffsets` retry. You are right about the consequence: `RetryUtils` returns `null` at `RetryUtils.java:79` once retries are exhausted with `false`, and `RocketMqIT.java:557` then does `currentOffsets.containsKey(mq)`, so a genuine failure would have surfaced as a bare NPE with `lastException` discarded. Reading that method again, `false` costs a second thing you did not mention: at `RetryUtils.java:51-54` an exception the predicate rejects is swallowed rather than rethrown, so a non-retriable failure quietly burns the remaining attempts and also ends at that `null`. `true` fixes both. The comment now says why this call differs from its neighbour.
   
   I have deliberately not changed the `offsetTopics` retry above it, which has the same property: exhaustion there returns `null` and `consumer.assign(null)` follows. That one is pre-existing rather than introduced here, and widening this PR to cover it felt like the wrong trade. Say the word if you would rather it went in too.
   
   **Issue 2.** Corrected. The comment claimed `currentOffsets` already raises `RocketMqConnectorException`, which is only true after #12349. It now says that on `dev` the call still maps a failed lookup onto an empty map, that the wrapper is a consistency fix today, and that it becomes load bearing once #12349 merges.
   
   **Issue 3.** Corrected, though I have reached a different conclusion on the second half and want to explain rather than quietly diverge.
   
   You are right that the guard confirms this topic's route while `currentOffsets` resolves `%RETRY%<group>`. I think it still covers that read, for a reason the old comment did not give: the name server drops routes per broker rather than per topic, so a resolvable route for the data topic means the broker registration is live and the retry topic's route with it. The retry topic exists by that point because the job has already consumed with that group. The comment now states exactly that, and says plainly that it is a short-gap guard, since `waitForTopicRoute` gives up after a minute and the 4m24s outage would still fail, only with a route message rather than an opaque assertion timeout.
   
   On widening `checkOffsetNoDiff` to 60 seconds, I would rather not. Neither 30 nor 60 seconds survives a multi-minute gap, so the widening buys no real resilience, and keeping the window tight means a genuine offset mismatch still fails fast. It is also the opposite of the position I argued on #12323 and you accepted there, that we remove causes rather than widen windows. Happy to be overruled if you see it differently.
   
   **Issue 4.** `waitForTopicRoute("test_topic_message_tag")` added to `testSinkRocketMqMessageTag` before the read, matching the sibling sink tests.
   
   Verified locally: `verify` passes on JDK 11, and `spotless:check` separately with up-to-date caching disabled. The branch is rebased onto current `dev`, so it now sits on top of #12393, #12395 and #12396.
   


-- 
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] [Fix][E2E] Retry and route-guard the remaining RocketMqIT offset reads [seatunnel]

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

   > @nzw921rx heads up on an overlap: this PR and your #12350 both edit `RocketMqIT.java`, so whichever lands second will need a rebase.
   > 
   > This one is +30/-5 on that file, approved, CI green. #12350 is +51/-59 and currently conflicts with `dev`, probably from #12323, #12393 and #12396 landing in that file after it was opened. The two do not overlap in intent, since this change only wraps the remaining offset reads in the retry and route guard that are already in the file. If you would rather land #12350 first, I will rebase this on top of it and re-verify.
   > 
   > #12349 is the same area and in the same state, approved and green, open since 09-16. It is the production fix behind #12332, and SEZ9 confirmed on 09-20 that nothing further is needed there.
   > 
   
   Thanks for the heads-up. Please go ahead with this PR. I’ll rebase #12350 onto the latest dev afterward


-- 
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] [Fix][E2E] Retry and route-guard the remaining RocketMqIT offset reads [seatunnel]

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


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