Print graph & transaction on optimization failure #321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
I got into an issue where the optimization failed. I've not been able to find the root cause. If it happens again, the graph and transaction at the time of failure would be extremely useful.
Motivation
Note that when the optimization fails we shutdown the node, so even if we notify the fuse publishers, there's no guarantee they have time to actually publish the graph and transaction. Even in that case, I usually throttle the graph publication because it has a significant overhead. I can re-create the graphs later, using the transactions, but that's a bit tedious. If we get the graph and transaction printed right away in the FATAL log message, I hope we can easily figure out the root cause, which I believe it's related to the transaction callback logic and a corner case with the transactions timestamps that we're stilling failing to handle properly.