[codex] fix celery worker stability and workflow tracking#1473
Merged
Conversation
Collaborator
|
This branch name is not following the standards: feature/|bugfix/|release/|hotfix/|support/|releasing/|dependabot/ |
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.
What Changed
Why
The Celery review found both correctness issues and a likely worker-stability issue.
On the live cluster, the last
celeryworkerrestart exited with code133, and the previous worker logs showed LiteLLMQueue ... is bound to a different event looperrors before process termination. The worker currently runs threaded Celery tasks while some task paths create fresh event loops viaasyncio.run()/ manual loop wrappers. LiteLLM's process-global async logging worker is not safe under that pattern, so this change disables that async callback path inside Celery worker processes.Separately, workflow status tracking was reporting the outer trigger task rather than the terminal chord result, and skipped tasks could be misreported as failures.
Impact
Validation
python3 -m py_compile config/celery.py config/celery_tasks.py aperag/tasks/scheduler.py aperag/service/evaluation_service.py aperag/llm/litellm_logging.pyceleryworkerlogs to confirm the restart signature and LiteLLM event-loop errors