-
Notifications
You must be signed in to change notification settings - Fork 238
chore: better output on errors #2879
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
Conversation
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
Summary of ChangesHello @alpe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request primarily focuses on enhancing the system's error reporting and debugging capabilities. It introduces more detailed panic logging for the node and refines the logging mechanism for commands executed within end-to-end tests. Additionally, it includes a minor adjustment to a default constant and an update to a function's parameter type for P2P key handling. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
I'll analyze this and get back to you. |
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.
Code Review
This pull request aims to improve error outputs, and the core change to add stack traces to panic logs is a good improvement. However, I've found a few issues:
- There's a critical compilation error due to an incomplete refactoring of P2P-related code, where a
*key.NodeKeyis passed to a function expecting a*p2p.Client. - The PR includes an unrelated functional change to
DefaultMaxBlobSize, which should ideally be in its own PR. - The buffer for capturing stack traces is quite small and should be increased to avoid truncated stacks.
The changes in the e2e test helper for better log handling are well-implemented. I recommend addressing the critical issue and considering my other suggestions to improve the quality of this PR.
| if r := recover(); r != nil { | ||
| err := fmt.Errorf("node panicked: %v", r) | ||
| logger.Error().Interface("panic", r).Msg("Recovered from panic in node") | ||
| buf := make([]byte, 1024) |
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.
The buffer size of 1024 bytes for capturing the stack trace might be too small for complex panics, potentially leading to truncated and incomplete stack traces. This would hinder debugging, which is contrary to the goal of this PR. It's recommended to use a larger buffer. For example, Go's net/http server uses a 64KB buffer for panic recovery.
| buf := make([]byte, 1024) | |
| buf := make([]byte, 64*1024) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2879 +/- ##
==========================================
+ Coverage 64.76% 64.81% +0.05%
==========================================
Files 81 81
Lines 7328 7330 +2
==========================================
+ Hits 4746 4751 +5
+ Misses 2041 2038 -3
Partials 541 541
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

Overview
Minor updates to make it easier to trace errors
Extracted from #2836