Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[air] Fix traceback context swallowing in training jobs #29143

Merged
merged 3 commits into from
Oct 7, 2022

Conversation

krfricke
Copy link
Contributor

@krfricke krfricke commented Oct 6, 2022

Signed-off-by: Kai Fricke kai@anyscale.com

Why are these changes needed?

We currently raise skip_exceptions(e) from None to reduce the stacktrace output of failing functions. However, in python this means that the context is swallowed completely, even if skip_exceptions(e) returns an exception with context. the from None takes precedence.
The solution here is to extract the cause manually from the new skip_exceptions(e)-Exception and raise from this context. The tests are still passing (thus for regular cases the traceback remains compact), but the repro script in #29097 will reveal the actual cause of the error.

Related issue number

Closes #29097

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Kai Fricke <kai@anyscale.com>
@krfricke krfricke requested a review from Yard1 October 6, 2022 23:23
Signed-off-by: Kai Fricke <kai@anyscale.com>
# Conflicts:
#	python/ray/tune/trainable/trainable.py
@krfricke krfricke merged commit c5c3e6c into ray-project:master Oct 7, 2022
@krfricke krfricke deleted the air/swallowing-error branch October 7, 2022 13:07
WeichenXu123 pushed a commit to WeichenXu123/ray that referenced this pull request Dec 19, 2022
…29143)

We currently raise `skip_exceptions(e) from None` to reduce the stacktrace output of failing functions. However, in python this means that the context is swallowed completely, even if `skip_exceptions(e)` returns an exception with context. the `from None` takes precedence.
The solution here is to extract the cause manually from the new `skip_exceptions(e)`-Exception and raise from this context. The tests are still passing (thus for regular cases the traceback remains compact), but the repro script in ray-project#29097 will reveal the actual cause of the error.

Signed-off-by: Kai Fricke <kai@anyscale.com>
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
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.

[air] simple xgboost script swallowing error
2 participants