Bugfix/fix ray re-init fail #902#903
Open
FangwenDave wants to merge 2 commits into
Open
Conversation
Add 'one change at a time' principle to the Development Workflow section: - Don't refactor when adding features - Don't add features when refactoring This prevents bugfix PRs from sneaking in unrelated structural changes (method extraction, renaming, call-chain adjustments).
Root cause: when ray.init() raised non-InternalServerRockError exceptions during scheduled reconnect, the exception was uncaught and Ray was left in shutdown state. Subsequent .remote() calls triggered Ray's auto-init hook, which started a full local Ray cluster on the admin machine. Multiple concurrent requests each spawned their own local cluster, exhausting memory and causing OOM kill. Changes: - main.py: set RAY_ENABLE_AUTO_CONNECT=0 before any ray import to disable Ray auto-init entirely - ray_service.py: wrap ray.init() with asyncio.wait_for timeout to prevent indefinite blocking when head-side specific-server hangs - ray_service.py: add 'except Exception' branch in _reconnect_ray to catch ray.init() failures and trigger _retry_ray_init recovery - ray_service.py: verify connection via ray.cluster_resources() after init (init success alone does not guarantee usable connection) - config.py: add ray_init_timeout_seconds (default 60s) config Tests: add 4 cases covering exception capture, retry success/failure, and init-hang timeout scenarios.
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.
fix issue #902