-
Notifications
You must be signed in to change notification settings - Fork 2
fix: critical robustness improvements and zombie trace suppression #618
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
Summary of ChangesHello @pitabwire, 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 significantly enhances the robustness and reliability of the framework by addressing several critical issues related to concurrency, resource management, and error handling. The changes aim to prevent common failure modes such as race conditions, goroutine leaks, and application crashes during initialization, promoting a more stable and predictable service operation. By transitioning from abrupt panics to graceful startup error reporting, the framework now offers better diagnostic capabilities and resilience. Highlights
Changelog
Activity
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
|
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 introduces a comprehensive set of fixes that significantly enhance the robustness and reliability of the framework. The changes address critical issues such as race conditions, resource leaks, goroutine leaks, and panics during startup, replacing them with more graceful error handling mechanisms. The introduction of sync.RWMutex for map access, a Close() method for graceful shutdown of background tasks, and the consistent use of a startup error aggregation pattern are all excellent improvements. The API change in workerpool.NewManager to return an error instead of panicking is also a welcome change that aligns with Go best practices. The test updates are thorough and correctly validate the new behaviors. I have one minor suggestion to simplify a test file by using a standard library function. Overall, this is a high-quality contribution that makes the framework much more stable.
options_queue_test.go
Outdated
| func contains(s, substr string) bool { | ||
| return len(s) >= len(substr) && searchString(s, substr) | ||
| } | ||
|
|
||
| func searchString(s, substr string) bool { | ||
| for i := 0; i <= len(s)-len(substr); i++ { | ||
| if s[i:i+len(substr)] == substr { | ||
| return true | ||
| } | ||
| } | ||
| return false | ||
| } |
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.
These helper functions contains and searchString reimplement the functionality of the standard library's strings.Contains. It's more idiomatic and simpler to use the standard library function directly. You can remove these functions and use strings.Contains where contains is called (on line 79). Remember to add "strings" to your imports.
- Close connections on error paths in JetStream KV, Redis, and Valkey cache backends - Use atomic.Int64 for event test counters, add mutex protection for shared state - Add Close() to security.Manager to stop JWKS background refresh goroutine - Replace panic/Fatal calls during init with graceful AddStartupError pattern - Replace uninitialized gRPC errorChannel with reportError callback - Change workerpool.NewManager to return (Manager, error) instead of panicking - Strip trace context from queue Receive() polls to suppress gocloud.dev internal spans - Replace parent-child trace propagation with span links for message processing - Update semconv from v1.37.0 to v1.39.0 to resolve OTel schema URL conflict - Use strings.Contains instead of custom helpers in test Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
facd4f8 to
7c9ee55
Compare
Summary
atomic.Int64for event test counters, add mutex protection for shared state, fix concurrent map access in security managerReceive()polls to prevent gocloud.dev internal spans, replace parent-child trace propagation with span links for message processing to eliminate long-running zombie root traces-raceflagworkerpool.NewManagernow returns(Manager, error)instead of panicking on failureTest plan
go build ./...compiles cleanlygo test ./... -race -count=1passes all tests with race detector🤖 Generated with Claude Code