fix: shorten manual cron profile lock scope#1749
Closed
Michaelyklam wants to merge 3 commits intonesquena:masterfrom
Closed
fix: shorten manual cron profile lock scope#1749Michaelyklam wants to merge 3 commits intonesquena:masterfrom
Michaelyklam wants to merge 3 commits intonesquena:masterfrom
Conversation
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thinking Path
run_job()duration.cron_profile_context_for_home()can enter while a manual cron job is still running.What Changed
_run_cron_job_in_profile_subprocess()and a spawned child-process target for manual cron execution inapi/routes.py._run_cron_tracked()so the longrun_job(job)body executes in the child process under the selected execution profile home instead of holding the parent_cron_env_lock.Fixes #1574
Why It Matters
_cron_env_lock.run_job()undercron_profile_context_for_home(execution_profile_home).Verification
tests/test_issue1574_cron_profile_lock.py::test_manual_cron_run_does_not_hold_profile_lock_for_job_durationfailed before the fix because the contender profile context stayed blocked while fakerun_job()was active.tests/test_cron_manual_run_persistence.py tests/test_issue1574_cron_profile_lock.py tests/test_issue617_cron_profile_selector.py tests/test_cron_run_job_import.py tests/test_scheduled_jobs_profile_isolation.py -q->22 passed in 2.07stests/test_sprint3.py tests/test_sprint6.py tests/test_sprint7.py tests/test_sprint10.py tests/test_sprint13.py tests/test_cron_manual_run_persistence.py tests/test_scheduled_jobs_profile_isolation.py tests/test_issue1574_cron_profile_lock.py tests/test_issue617_cron_profile_selector.py tests/test_cron_run_job_import.py -q->115 passed in 8.00sgit diff --check-> passedtests/test_sprint3.py::test_session_search_returns_matches tests/test_sprint4.py::test_session_search_returns_matches -q->2 passed in 1.64s.ConnectionRefusedErrorfailures; representative checks passed afterward:tests/test_sprint1.py::test_health tests/test_regressions.py::test_chat_start_returns_stream_id tests/test_issue1680_codex_spark.py::test_openai_codex_group_uses_provider_model_ids_for_spark -q->3 passed in 6.09s.Risks / Follow-ups
Model Used