-
-
Notifications
You must be signed in to change notification settings - Fork 572
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
Add traceback information to exceptions during docbuild #31005
Comments
Author: Tobias Diez |
comment:3
The patchbot reports failures for the files that are changed by the branch:
To help the review, may you add an example in the description field of the kind of new information printed in the dochtml.log when an error (warning) occurs? |
This comment has been minimized.
This comment has been minimized.
comment:5
Thanks for the review. I've now extended the ticket description and fixed the doctests. |
comment:7
I've been having problems building the documentation on OS X Big Sur with the latest Xcode + homebrew. This ticket didn't have any apparent effect on the traceback. |
comment:8
@jhpalmieri: So you mean you got an exception in one of the workers, but the traceback still didn't included the proper origin of the exception? That's a bit strange, it's working for me. |
comment:9
Yes, with the failure in #31344. |
comment:10
That makes sense. In #31344, no exception is thrown but the process ends with an error code, which then triggers
In this case, no stacktrac is added since this information is simply not available. The worker needs to throw an exception (including a stacktrace) so that the exception handler in
is invoked. This needs changes to the particular worker, and should be done in a follow-up issue. |
comment:11
Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date. |
comment:12
Setting a new milestone for this ticket based on a cursory review. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
Did the GH actions pass? My only suggestion would be to make |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:17
Thanks for the review. I've now moved _rebuild_exc to a local method in reduce. |
comment:18
Replying to @tobiasdiez:
Hm, this is even better. But now another refactoring is suggesting itself. Instead of, def __reduce__(self):
def _rebuild_exc(exc: BaseException, tb: str):
"""
Reconstructs the exception, putting the original exception as cause.
"""
exc.__cause__ = RemoteException(tb)
return exc
return _rebuild_exc, (self.exc, self.tb) couldn't we just do def __reduce__(self):
self.exc.__cause__ = RemoteException(self.tb)
return self.exc ? I also think we'll need doctests for the new classes/methods even if they're pretty trivial. Otherwise our coverage goes down. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:20
Replying to @orlitzky:
I don't have much experience with pickling, but https://docs.python.org/3/library/pickle.html#object.__reduce__ says that either a string or tuple should be returned. My solution also didn't worked as
I've added a doctest for the reduce method. The other methods are still covered by the existing doctests. |
comment:21
Replying to @tobiasdiez:
I know, I was referring specifically to (before):
and (after):
Normally the patchbots would have complained (see the "coverage" plugin), but in this case I think the special nature of the sage_docbuild package avoided it. I've been on the other side of this argument more than once, so I feel for you, but the developer's guide still states that every function needs a docstring: https://doc.sagemath.org/html/en/developer/coding_basics.html#documentation-strings |
comment:23
I've added the missing docstrings. But since none of the methods in this class have any tests, I don't have that much motivation to add tests for trivial constructor / properties ;-) |
comment:24
Test bot is green, anything else to do? |
comment:25
I forgot what I was waiting for, so it must be OK. |
Reviewer: Michael Orlitzky |
comment:26
Thanks! |
Changed branch from public/documentation/add_traceback to |
The docbuild was failing for me, and it was hard to track down where the original error occurred because there was no (proper) traceback information. In this ticket, such a traceback information is added for exceptions in the docbuild worker following the approach taken in https://bugs.python.org/issue13831.
Example output:
for the test file
CC: @dimpase @jhpalmieri @seblabbe @slel @orlitzky
Component: documentation
Author: Tobias Diez
Branch/Commit:
c37d055
Reviewer: Michael Orlitzky
Issue created by migration from https://trac.sagemath.org/ticket/31005
The text was updated successfully, but these errors were encountered: