You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "preko-p (via GitHub)" <gi...@apache.org> on 2026/06/03 10:55:49 UTC
[PR] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
preko-p opened a new pull request, #11002:
URL: https://github.com/apache/seatunnel/pull/11002
### Purpose of this pull request
Fixes #10999.
This PR prevents `MongodbReader.closeCurrentSplit()` from masking the original MongoDB cursor creation failure with a cleanup-path `NullPointerException`.
When `getCursor(currentSplit)` fails before assigning `cursor`, `pollNext()` still runs `closeCurrentSplit()` in the `finally` block. The previous `Preconditions.checkNotNull(cursor)` could throw a new `NullPointerException` and hide the real MongoDB connection, auth, or query error. The cleanup path now returns when no cursor exists and preserves the original failure.
### Does this PR introduce _any_ user-facing change?
Yes.
When MongoDB cursor creation fails, users should now see the original MongoDB connector failure instead of a misleading cleanup `NullPointerException`.
There is no connector option, API, packaging, or documented configuration change.
### How was this patch tested?
Added unit coverage in `MongodbReaderTest`:
- `pollNextPreservesOriginalCursorCreationException()` verifies the original cursor creation exception is preserved.
- `pollNextClosesCursorWhenDeserializationFails()` verifies an already-created cursor is still closed when downstream deserialization fails.
Local verification:
```bash
./mvnw -pl seatunnel-connectors-v2/connector-mongodb -DskipITs -DskipIT -DskipE2E -DskipTests=false -DfailIfNoTests=false -Dtest=MongodbReaderTest test
./mvnw -pl seatunnel-connectors-v2/connector-mongodb -DskipITs -DskipIT -DskipE2E -DskipTests=false -DfailIfNoTests=false test
./mvnw -pl seatunnel-connectors-v2/connector-mongodb spotless:check
git diff --check
```
Results:
- Targeted reader tests: 2 passed.
- MongoDB connector module tests: 12 passed.
- Spotless: passed.
- Diff whitespace check: passed.
### Check list
* [x] No new Jar binary package is added by this PR.
* [x] Documentation update is not necessary because this is an internal bug fix with no connector option or usage change.
* [x] `incompatible-changes.md` update is not necessary because this does not introduce an incompatibility.
* [x] Existing connector metadata, distribution POM, label scope, E2E, and plugin config updates are not necessary because this fixes an existing MongoDB connector reader cleanup path and does not add a new connector or packaging surface.
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4618191709
Thanks. From Daniel's side I do not have any new code-review concern on the current head.
The remaining item here looks like workflow approval / CI metadata rather than a reopened source bug. Once that is enabled on the PR, this should be fine to move forward 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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4658918631
Thanks for digging into this and for documenting the unblock steps so clearly.
I rechecked the PR metadata on the current head `9d16dd2`, and my source-level conclusion is still unchanged: I do not see a new code-review blocker in the MongoDB reader fix itself.
What is still blocking this PR from moving forward is the GitHub-side `Build` check. On the current head it is still ending in `ACTION_REQUIRED` / workflow-run detection failure, so this still looks like a workflow-registration or maintainer-approval issue rather than a source change issue in this branch.
From my side I do not have an additional code change to ask for here. The next useful step would be for a maintainer with the right Actions permissions to approve or re-trigger the workflow from the PR checks page. If that still fails after maintainer-side approval, I would treat it as a CI/infrastructure follow-up instead of asking you for another source-level change on this PR.
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "preko-p (via GitHub)" <gi...@apache.org>.
preko-p commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4658138509
I retried the fork-side unblock steps and the source branch is now on current `dev`.
What I did:
- rebased on current `dev` and force-pushed the PR branch
- verified fork Actions permissions: enabled, `allowed_actions: all`
- pushed an empty trigger commit (`9d16dd2`) after the rebase
That did trigger fresh Apache-side checks (`Notify test workflow` and `labeler` both passed), but the `Build` check still ends with `Workflow run detection failed`.
One odd detail: the fork Actions API currently reports zero registered workflows for `preko-p/seatunnel`, even though the workflow files are present in the fork. I do not see a source-code change left to make on the PR branch itself. Could a maintainer trigger/approve the workflow from the upstream side, or advise what else you want me to do for the fork workflow registration?
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "zab-oza (via GitHub)" <gi...@apache.org>.
zab-oza commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4641717410
Hello @preko-p again,
please can you rush and fix the blocker from your side ASAP ?
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo closed pull request #11002: [Bug][Connector-V2] Fix MongoDB reader cursor cleanup
URL: https://github.com/apache/seatunnel/pull/11002
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-5120215859
Thanks again for the contribution. I rechecked the current PR state, and Daniel's source-level conclusion is still unchanged: the MongoDB reader cursor-cleanup fix itself is already approved from my side, and I do not see a reopened code blocker on the current head.
The remaining gate is still the `Build` workflow approval / detection path rather than a source change in this branch. The current check run is here: https://github.com/apache/seatunnel/runs/88969435884
For the next step, please make sure GitHub Actions is enabled for the fork and that the workflow is allowed to run from the PR checks page. If this still cannot be triggered after that, this should be handled as a maintainer-side Actions/workflow approval issue, not by adding unrelated code changes to this PR.
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4703715691
Thanks for the ping. From Daniel's side the code-review conclusion is still unchanged on the current head: I do not see a reopened source-level issue in the MongoDB cursor cleanup fix itself.
What is still blocking this PR is the GitHub-side Build workflow approval / trigger path, not a new code change request from me. If a maintainer can approve or re-run the workflow from the checks page and it goes green, I do not have an additional source-level blocker here.
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-5350105619
结论:为保障 3.0.0 发版节奏,原 #11002 的修复已由新的 #11887 承接,旧 PR 将在本评论后关闭,避免两个入口的 CI 与 review 状态继续分叉。
非常感谢 @preko-p 提交这个细致的 MongoDB reader 清理修复。原 PR 的源码审查结论一直是通过的,但 fork 侧 Build 长期无法恢复到可交付状态。新 PR 基于当前 `dev` 创建,只保留这项修复和两条回归测试;提交仍保留原 Git author 信息 `preko06 <is...@workl.com>`,便于完整保留你的贡献记录。
新的 CI 已在 #11887 对应的 Daniel fork 分支启动。后续请以 #11887 为准;再次感谢你的耐心和贡献。
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-5192193000
Thanks for your contribution! This is a solid addition to the project, and your attention to detail really shows. Contributors like you are what keep this community moving forward. Feel free to keep the PRs coming — we're always glad to have you here!
Please ignore the following message if you have joined in the Slack~
```
To facilitate focused communication among contributors, we’ve created a brand-new dedicated #contributors channel in official Slack workspace.
Slack workspace link: https://s.apache.org/seatunnel-slack
This channel is designed for technical discussions, feature design brainstorming, roadmap sync and direct communication with project core Contributors. Everyone who contributes code, docs, test cases or community ideas is warmly invited to join, share thoughts and collaborate together under The Apache Way. Welcome to join 😄
```
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "zab-oza (via GitHub)" <gi...@apache.org>.
zab-oza commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4636872802
Hey @preko-p ,
the only remaining blocker is the Build CI check. It looks like GitHub Actions couldn't detect the workflow run on your fork.
Could you try the following to unblock it?
```bash
git fetch upstream
git rebase upstream/dev
git push origin ai-os/seatunnel-10999-mongodb-reader-cleanup --force
```
If that doesn't trigger the build, also check that GitHub Actions is enabled on your fork under **Settings → Actions → Allow all actions**.
The code itself is already approved — this is the last step before merge. Thanks!
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4621351293
Thanks for retrying the workflow.
I rechecked the PR state on the current head and there is still no code change after my last approval, so my code-review conclusion stays the same from my side. If the CI run completes cleanly, I do not have any additional source-level blocker here.
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4698166399
CI check can't run now. Please enable CI check through the following URL https://github.com/apache/seatunnel/pull/11002/checks?check_run_id=79280872402
<img width="2494" height="1340" alt="image" src="https://github.com/user-attachments/assets/e74d23ee-06b7-4325-bede-5d309231243c" />
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4613867175
Please enable CI check through the following URL https://github.com/apache/seatunnel/pull/11002/checks?check_run_id=79280872402
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4642242428
Thanks for following up here.
From my side the code-review conclusion is still unchanged on the current head `55a1263` — there has not been any new code since the approval, and I do not see an additional source-level blocker in the PR itself.
At this point the only remaining blocker still looks like the fork-side `Build` workflow approval / trigger. Once that workflow is allowed to run and finishes cleanly, I do not have anything else to hold back on the code 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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "chl-wxp (via GitHub)" <gi...@apache.org>.
chl-wxp commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4618401074
retry ci
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4638290982
Thanks for helping unblock the workflow.
From my side the source-level review is still unchanged on the current head — no new code landed after the approval, so I do not have any additional code-review blocker here. At this point I am only waiting on the fork-side `Build` workflow to get approved / triggered cleanly.
## Expected state after posting
- Status: `REPLIED_NOT_REVIEWED`
- Reason: new discussion only, no new commit
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "preko-p (via GitHub)" <gi...@apache.org>.
preko-p commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-4657760513
Done. I rebased the branch on current `origin/dev` and force-pushed it back to the fork branch as requested.
The PR now shows fresh pending checks for the new head, so GitHub did pick up the update this time. I’ll keep an eye on the run and follow up if anything source-level fails.
--
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] [Bug][Connector-V2] Fix MongoDB reader cursor cleanup [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11002:
URL: https://github.com/apache/seatunnel/pull/11002#issuecomment-5129172374
Good job.
Thanks a lot for your valuable contribution to Apache SeaTunnel!
To pass the automated CI checks for this PR, could you please enable or approve the CI workflow for this branch first? You can use this current check run as the reference: https://github.com/apache/seatunnel/runs/88969435884
I also recorded that the branch is currently `diverged` against `dev` (`ahead_by=3`, `behind_by=320`), so after CI is allowed to run, syncing the latest `dev` and rerunning Build may still be needed if GitHub asks for it.
If you run into any trouble enabling CI or encounter related errors during the process, feel free to leave a comment here. Contributors are always ready to offer help~
--
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