Refactor WorkflowEngine._run_node to break memory-leaking reference cycle#104
Refactor WorkflowEngine._run_node to break memory-leaking reference cycle#104shenald-dev wants to merge 13 commits into
Conversation
…ycle Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
@shenald-dev this PR has merge conflicts with To resolve manually: Alternatively, you can try updating your branch with the latest from |
|
The change looks sound and addresses a real memory-leak issue. Please resolve the merge conflicts with main (as indicated in the comment) and ensure the updated code still passes all tests. Once conflicts are resolved, this PR is ready to merge. Reviewed — quality: high |
AI-assisted conflict resolution — merged changes from main into jules-2009659457805719597-e7b8ddbe (3-way merge with ancestor context)
I have successfully fetched |
Thank you for the review! I have completely resolved the merge conflicts with |
…ycle and resolve conflicts with main Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
@shenald-dev I went through the conflicts and resolved them — merged the changes from ⏳ CI needs to run on the new commits before merging. Will auto-merge on the next cycle if checks pass. 🔧 Used 3-way merge with ancestor context for more accurate resolution. 📦 A backup ref was created: Take a look and let me know if anything looks off 👍 |
Acknowledged. Thanks for merging |
Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
🔄 Re-evaluating based on recent changes: The refactor looks sound and addresses a real memory-leak issue. Please resolve the merge conflicts with main (as indicated in the comments) and ensure the updated code still passes all tests. Once conflicts are resolved, this PR is ready to merge. Reviewed — quality: high |
Acknowledged. Thanks for the final review! |
|
🔄 Re-evaluating based on recent changes: The code change effectively addresses the memory leak by breaking the reference cycle, which is sound and well-justified. However, the PR currently has merge conflicts with main that must be resolved manually. Once conflicts are resolved and tests pass, this PR is ready to merge. Reviewed — quality: high |
I have previously resolved the merge conflicts with |
… leaks Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
AI-assisted conflict resolution — merged changes from main into jules-2009659457805719597-e7b8ddbe (3-way merge with ancestor context)
AI-assisted conflict resolution — merged changes from main into jules-2009659457805719597-e7b8ddbe (3-way merge with ancestor context)
|
@shenald-dev I went through the conflicts and resolved them — merged the changes from ⏳ CI needs to run on the new commits before merging. Will auto-merge on the next cycle if checks pass. 🔧 Used 3-way merge with ancestor context for more accurate resolution. 📦 A backup ref was created: Take a look and let me know if anything looks off 👍 |
Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
🔄 Re-evaluating based on recent changes: The refactor looks sound and addresses a real memory-leak issue. Please resolve the merge conflicts with main (as indicated in the comment) and ensure the updated code still passes all tests. Once conflicts are resolved, this PR is ready to merge. Reviewed — quality: high |
I have successfully resolved the merge conflicts with |
Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
Hey @shenald-dev, heads up — this PR has merge conflicts with To fix: |
|
The refactor looks sound and addresses a real memory-leak issue. Please resolve the merge conflicts with main as indicated in the comments, then ensure the updated code still passes all tests. After conflicts are resolved, the PR should be ready to merge. Reviewed — quality: high |
I have successfully fetched |
Thank you for reviewing! I've resolved all merge conflicts by rebasing onto |
Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
🔄 Re-evaluating based on recent changes: The refactor effectively breaks the memory-leaking reference cycle as described. However, merge conflicts with main must be resolved before merging. After conflict resolution, ensure tests pass again (especially given the extensive changes in engine.py and lockfile). Reviewed — quality: high |
I've successfully completely rebased onto the |
Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
🔄 Re-evaluating based on recent changes: The refactor is sound and addresses a real memory-leak issue. Please resolve the merge conflicts with main as described in the comments, then ensure the test suite passes. After that, the PR is ready to merge. Reviewed — quality: high |
I have previously successfully rebased on |
|
🔄 Re-evaluating based on recent changes: The PR addresses a critical memory leak by breaking reference cycles in WorkflowEngine._run_node. The solution is technically sound and well-verified. However, merge conflicts with main must be resolved before merging. Please follow the conflict resolution instructions in the comments, then ensure tests pass. Once conflicts are resolved, this PR is ready for merge. Reviewed — quality: high |
I have previously successfully rebased and force-pushed the branch resolving all conflicts from |
Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
Hey @shenald-dev, heads up — this PR has merge conflicts with To fix: |
I have previously successfully rebased and force-pushed the branch resolving all conflicts from |
Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
Please resolve the merge conflicts with main as indicated in the comments and ensure the updated code passes all tests. Once done, this PR is ready to merge. Reviewed — quality: high |
It looks like the conflicts have completely resolved on my end. I've rebased to the absolute newest |
Refactored the internal signature of
WorkflowEngine._run_nodeto pass pre-resolved tuples ofasyncio.Taskdependencies instead of the globaltasksdictionary.tasksdictionary into the coroutine context created a severe memory-leaking reference cycle: the dictionary held tasks, which wrapped coroutines, which retained the full scope dictionary.tupleof solely the explicitly required dependentTaskfutures breaks the cyclic reference entirely, drastically reducing cyclic Garbage Collector (GC) pressure for high-throughput pipeline execution, while avoiding dictionary lookups in the asynchronous loop hotpath.pytest tests/,mypy src tests, andruff check src tests. The unit test suite confirms fail-fast and successful execution paths continue to behave appropriately.PR created automatically by Jules for task 2009659457805719597 started by @shenald-dev