-
Notifications
You must be signed in to change notification settings - Fork 151
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
gracefully handle elided frames #120
Conversation
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.
LGTM. Thank you for the contribution!
"goroutine 1 [running]:", | ||
"example.com/foo/bar.baz()", | ||
" example.com/foo/bar.go:123", | ||
"...3 frames elided...", |
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.
In addition to this fixed data test case, can we add or update a test that creates a goroutine with a deep stack that leads to elided frames, and verify that? That way, we'll have coverage that will detect if the elided message has changed.
This is a real concern, when the eliding logic was originally added, it used "stack frames omitted". Given that it has changed, we should have a test that will detect changes by relying on the real runtime logic.
@prashantv addressed both comments. If everything looks good, please help merge it in :) - I don't have the necessary permisisons. |
Follow-up to #120, I accidentally merged the PR without waiting for all tests to run, and missed that 1.20 tests are failing. Lint is failing because of how we skip golangci-lint run in the action and use the Makefile. Use the same logic as zap to skip lint. Tests are failing on 1.20 as stack elision doesn't kick in for the test. From 1.21 onwards, it does kick in. Rather than try to make the test trigger stack elision on 1.20, let's bump the versions to 1.21 / 1.22.
When parsing stacks we frequently encounter elided frames. The actual stack line looks something like
...23 frames elided...
, which is passed toparseFuncName
, which of course is not parsable as a function name. As a result, whenever this happens we get a useless panic like the following:This PR gracefully handles elided frames to prevent the panic.