Skip to content

Conversation

@matthewdeng
Copy link
Contributor

Description

Update formatting of FailurePolicy log message to be more readable.

Additional information

Before:

[FailurePolicy] Decision: FailureDecision.RAISE, Error source: controller, Error count / maximum errors allowed: 1/0, Error: Training failed due to controller error:
Worker group is not active. Call WorkerGroup.create() to create a new worker group.

After:

[FailurePolicy] RAISE
  Source: controller
  Error count: 1 (max allowed: 0)

Training failed due to controller error:
Worker group is not active. Call WorkerGroup.create() to create a new worker group.

Signed-off-by: Matthew Deng <matthew.j.deng@gmail.com>
@matthewdeng matthewdeng requested a review from a team as a code owner October 29, 2025 04:05
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully improves the readability of the failure policy log message by reformatting it into a multi-line string. The change is clear and effective. I have provided one suggestion to use a single multi-line f-string, which could make the code that generates the message even more readable and idiomatic.

Comment on lines +45 to +48
f"[FailurePolicy] {decision.value}\n"
f" Source: {error_source}\n"
f" Error count: {error_count} (max allowed: {retry_limit})\n\n"
f"{training_failed_error}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For improved readability and to make the multi-line string structure more explicit, consider using a single triple-quoted f-string. This avoids repeating f"" and using explicit newline characters (\n), making the log message template easier to read and maintain.

f"""[FailurePolicy] {decision.value}
  Source: {error_source}
  Error count: {error_count} (max allowed: {retry_limit})

{training_failed_error}"""

@matthewdeng matthewdeng enabled auto-merge (squash) October 29, 2025 04:58
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Oct 29, 2025
@matthewdeng matthewdeng merged commit 444646e into ray-project:master Oct 29, 2025
6 of 7 checks passed
YoussefEssDS pushed a commit to YoussefEssDS/ray that referenced this pull request Nov 8, 2025
## Description
Update formatting of FailurePolicy log message to be more readable.

## Additional information

**Before:**

```
[FailurePolicy] Decision: FailureDecision.RAISE, Error source: controller, Error count / maximum errors allowed: 1/0, Error: Training failed due to controller error:
Worker group is not active. Call WorkerGroup.create() to create a new worker group.
```

**After:**

```
[FailurePolicy] RAISE
  Source: controller
  Error count: 1 (max allowed: 0)

Training failed due to controller error:
Worker group is not active. Call WorkerGroup.create() to create a new worker group.
```

Signed-off-by: Matthew Deng <matthew.j.deng@gmail.com>
landscapepainter pushed a commit to landscapepainter/ray that referenced this pull request Nov 17, 2025
## Description
Update formatting of FailurePolicy log message to be more readable.

## Additional information

**Before:**

```
[FailurePolicy] Decision: FailureDecision.RAISE, Error source: controller, Error count / maximum errors allowed: 1/0, Error: Training failed due to controller error:
Worker group is not active. Call WorkerGroup.create() to create a new worker group.
```

**After:**

```
[FailurePolicy] RAISE
  Source: controller
  Error count: 1 (max allowed: 0)

Training failed due to controller error:
Worker group is not active. Call WorkerGroup.create() to create a new worker group.
```

Signed-off-by: Matthew Deng <matthew.j.deng@gmail.com>
Aydin-ab pushed a commit to Aydin-ab/ray-aydin that referenced this pull request Nov 19, 2025
## Description
Update formatting of FailurePolicy log message to be more readable.

## Additional information

**Before:**

```
[FailurePolicy] Decision: FailureDecision.RAISE, Error source: controller, Error count / maximum errors allowed: 1/0, Error: Training failed due to controller error:
Worker group is not active. Call WorkerGroup.create() to create a new worker group.
```

**After:**

```
[FailurePolicy] RAISE
  Source: controller
  Error count: 1 (max allowed: 0)

Training failed due to controller error:
Worker group is not active. Call WorkerGroup.create() to create a new worker group.
```

Signed-off-by: Matthew Deng <matthew.j.deng@gmail.com>
Signed-off-by: Aydin Abiar <aydin@anyscale.com>
Future-Outlier pushed a commit to Future-Outlier/ray that referenced this pull request Dec 7, 2025
## Description
Update formatting of FailurePolicy log message to be more readable.

## Additional information

**Before:**

```
[FailurePolicy] Decision: FailureDecision.RAISE, Error source: controller, Error count / maximum errors allowed: 1/0, Error: Training failed due to controller error:
Worker group is not active. Call WorkerGroup.create() to create a new worker group.
```

**After:**

```
[FailurePolicy] RAISE
  Source: controller
  Error count: 1 (max allowed: 0)

Training failed due to controller error:
Worker group is not active. Call WorkerGroup.create() to create a new worker group.
```

Signed-off-by: Matthew Deng <matthew.j.deng@gmail.com>
Signed-off-by: Future-Outlier <eric901201@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants