feat: Implement diagnostic logic for fault tolerance - log retrieval and error classification#1696
Draft
Torino233 wants to merge 5 commits intointelligent-machine-learning:masterfrom
Draft
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (83.92%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #1696 +/- ##
==========================================
- Coverage 80.48% 80.46% -0.02%
==========================================
Files 228 228
Lines 23056 23107 +51
==========================================
+ Hits 18557 18594 +37
- Misses 4499 4513 +14 ☔ View full report in Codecov by Sentry. |
BalaBalaYi
reviewed
Feb 12, 2026
| log_content = "...[truncated]...\n" + log_content | ||
| except Exception as e: | ||
| logger.warning(f"Failed to get logs for actor {actor_id}: {e}") | ||
| log_content = f"[Failed to retrieve logs: {e}]" |
Collaborator
There was a problem hiding this comment.
Leave this empty or return a specific error code or constant. This makes it easier for the subsequent diagnostic process to analyze the content.
| if actor_id: | ||
| try: | ||
| log_lines = [] | ||
| for line in get_log(actor_id=actor_id): |
Collaborator
There was a problem hiding this comment.
need confirm: should tail the log
| logger.warning(f"Failed to get logs for actor {actor_id}: {e}") | ||
| log_content = f"[Failed to retrieve logs: {e}]" | ||
| else: | ||
| log_content = "[Actor ID not available, cannot retrieve logs]" |
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.
Summary
This PR implements the diagnostic logic for the fault tolerance mechanism. When a failure occurs, the system now collects actor logs, parses them to classify error types, and determines failure responsibility based on timestamps.
Changes
1. Enhanced
DiagnosticInfoclass (common/actor_base.py)code=0: Normal executioncode=1: Unknown errorcode=1001: CUDA OOM (FATAL)code=1002: NCCL/Communication errorcode=2001: User code exceptioncode=3001: System OOM killed (FATAL)2. Implemented log retrieval and diagnosis (
backend/common/base_worker.py)get_diagnostic()method to:ray.util.state.get_log(actor_id)_parse_diagnostic_info()to classify errors based on log patterns:3. Added responsibility determination (
controller/manager.py)_determine_failure_responsibility()method:ROOT_CAUSEBE_AFFECTEDis_failure_responsibility()check in_record_failure()