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
Cleanup remote tracebacks #10354
Cleanup remote tracebacks #10354
Conversation
b4ac95e
to
3fac9a1
Compare
65e4aa1
to
fb32bd6
Compare
b191357
to
a9cb145
Compare
@crusaderky Finally got the test passing. Lesson learned: never expect ipython to behave the same on different envs. This is now ready for review. One more thing I was thinking about adding to this PR: exposing a function to install the |
287d57b
to
bd6bca9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@j-bennet see my review commit
Merging as soon as you confirm you're happy with my changes
bd6bca9
to
f90a842
Compare
I don't think I follow. What function are you referring to? |
In the PR at the current state, as soon as the user imports something from Alternatively, wrapping excepthook could be something that's triggered by the user, by calling a method, let's say, |
I see your reasoning, but I feel that if we added a completely different API it would make things worse for the UX rather than better. |
Thank you! |
In dask/dask#10354 dask calls set_custom_exc to set a custom exception handler. This breaks solara with dask because we have a custom/fake IPython implementation. Fixes #191
Adds a utility function
shorten_traceback
, and wrapssys.excepthook
to apply it to unhandled exceptions.The behavior of the function is controlled by several settings:
admin.traceback.shorten.when
admin.traceback.shorten.what
If both are non-empty, and any of the stack frames match a pattern listed in
admin.traceback.shorten.when
, stack trace is shortened. Frames that match a pattern listed inadmin.traceback.shorten.what
are omitted. The method always preserves the first and last stack frame though.For
IPython
, instead ofsys.excepthook
, a custom exception handler is provided.The second part - adding worker info to the remote exception - is implemented in dask/distributed#7847.
Issue: dask/distributed#4880.
pre-commit run --all-files
As discussed with @crusaderky.