-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve rendering of complex tracebacks, prevent duplicate lines (#2780)
This commit reworks how lines are added to the traceback second section, which displays callsites where an exception has been propagated. It rework the presentation of that section to cater for more complex cases. As a benefit, it fixes a situation where an unbounded number of retries over a singleton exception + a checkpoint leads to infinitely growing traceback. It also polishes HooksTraceTest to result in less spammy logs, and updates the reference guide documentation to reflect the new style (as well as fixing some outdated content). The change especially helps when the exception is instantiated at publisher level but is propagated to several subscribe paths (eg. multiple chains assembled from the same source, or a single chain that resubscribe like with a retry operator). Previously, lines where effectively guaranteed to be added because the stored Tuple4 included a `i` variable that was always incremented. Now these traceback lines are stored in a `Map`, and effort is made to detect "multicasting" of the error. Lines that appear more than once are counted and this is reflected in the traceback line after the callsite (` (observed x times)`). An effort is made to group operators that belong to distinct chains together under a "root", which get repeated and is denoted by a `*_` prefix and `_` left-padding. Instead of: ``` |_ rootOp -> callsite1 |_ chainOneOp1 -> callsite2 |_ chainOneOp2 -> callsite3 |_ chainTwoOp1 -> callsite4 ``` We now get: ``` |*______rootOp -> callsite1 (observed 2 times) |_ chainOneOp1 -> callsite2 |_ chainOneOp2 -> callsite3 |*______rootOp -> callsite1 (observed 2 times) |_ chainTwoOp1 -> callsite4 ``` This makes it clearer that the error propagates through `rootOp`, which is used to construct two distinct chains (and subscriptions to both chains end up seeing the same instance of the error). Fixes #2774.
- Loading branch information
1 parent
0479a03
commit df44a2d
Showing
13 changed files
with
705 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.