You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "nkuprins (via GitHub)" <gi...@apache.org> on 2026/07/10 23:37:53 UTC
[PR] [Fix-18409][Common] Fix DAG.addEdge accepting an edge that creates a cycle when paths converge [dolphinscheduler]
nkuprins opened a new pull request, #18410:
URL: https://github.com/apache/dolphinscheduler/pull/18410
## Was this PR generated or assisted by AI?
YES - the bug was found using AI-assisted static analysis, and the fix and regression test were AI-assisted. I verified everything myself: I confirmed the failure by running the new test against unmodified `dev` (fails), reviewed the logic, and confirmed the fix (passes) with the full `dolphinscheduler-common` suite green.
## Purpose of the pull request
Closes #18409. `DAG.isLegalAddEdge` bounds its cycle-check BFS with a node-count budget (`--verticesCount > 0`) instead of tracking visited nodes. On graphs where paths converge, a node is enqueued once per incoming edge, exhausting the budget before the BFS reaches `fromNode`, so a cycle-creating edge is wrongly judged legal and inserted. This replaces the budget with a visited-set - the correct BFS termination condition - which cannot be defeated by path convergence and also avoids redundant re-enqueueing on dense graphs.
## Brief change log
- `common/graph/DAG.java`: track visited nodes in `isLegalAddEdge` instead of a decrementing `verticesCount` budget; add `HashSet` import.
- `common/graph/DAGTest.java`: add `testCycleWithConvergingPaths`, a fan-shaped graph asserting the cycle-creating back-edge is rejected and no cycle is introduced.
## Verify this pull request
This change added tests and can be verified as follows:
- `testCycleWithConvergingPaths` fails on current `dev` (`addEdge` returns `true` for a cycle-creating edge) and passes with the fix.
- Full `dolphinscheduler-common` suite passes (139 tests, 0 failures) on JDK 8.
- Spotless format check passes.
--
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@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-18409][Common] Fix DAG.addEdge accepting an edge that creates a cycle when paths converge [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS merged PR #18410:
URL: https://github.com/apache/dolphinscheduler/pull/18410
--
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@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-18409][Common] Fix DAG.addEdge accepting an edge that creates a cycle when paths converge [dolphinscheduler]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #18410:
URL: https://github.com/apache/dolphinscheduler/pull/18410#issuecomment-4978309197
Awesome work, congrats on your first merged pull request!
--
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@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-18409][Common] Fix DAG.addEdge accepting an edge that creates a cycle when paths converge [dolphinscheduler]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #18410:
URL: https://github.com/apache/dolphinscheduler/pull/18410#issuecomment-4940404358
Thanks for opening this pull request! Please check out our contributing guidelines. (https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.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@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org