Skip to content

fix(core): truncate the Run failure status message to the API limit - #6446

Open
AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/run-exit-status-message-length
Open

AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/run-exit-status-message-length

Conversation

@AkshayShah03

Copy link
Copy Markdown

Issue #, if available: N/A (v2 equivalent: #5276)

Description of changes:

When an exception escapes a with Run(...) block, Run.__exit__ records it as the trial component's failure status with message=str(exc_value).

The UpdateTrialComponent API limits Status.Message to 1024 characters (TrialComponentStatusMessage). A long exception message, such as a stack dump or an OOM message, therefore makes close() fail with a ValidationException from the service. That error replaces the user's original exception, and the run is never marked Failed or given an end time.

v2 truncates the message with MAX_STATUS_MESSAGE_LEN = 1024 (#5276); the v3 port lost that. This change restores it.

Testing:

  • New tests/unit/experiments/test_run_exit.py: a 2000-character exception is stored as a 1024-character message, and a short one is unchanged. The long case fails before this change.
  • tests/unit/experiments: 9 passed.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

When an exception escapes a 'with Run(...)' block, Run.__exit__ records it
as the trial component's failure status with message=str(exc_value). The
UpdateTrialComponent API limits Status.Message to 1024 characters, so a
long exception message (a stack dump, an OOM message) made close() fail
with a ValidationException from the service. That error replaced the
user's original exception, and the run was never marked Failed or given an
end time. v2 truncates the message (aws#5276); the v3 port lost it.

Truncate the message to MAX_STATUS_MESSAGE_LEN (1024), as v2 does.

This branch is waiting to be deployed

1 waiting deployment
manual-approval — 2322ccef Waiting Oct 12, 2026 by AkshayShah03 via wait-for-approval #1723
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant