⚡ Bolt: Reuse GCP clients and credentials#19
Conversation
Implement lazy-initialization and caching for GCP clients across all API packages. Initializing a new GCP client for every API call is expensive due to credential discovery and connection handshakes. By caching and reusing the clients within each GCPClient struct, we significantly reduce latency and redundant authentication, particularly during concurrent regional requests. Changes: - Added sync.Mutex and client field to GCPClient in service, job, execution, workerpool, domainmapping, and project packages. - Implemented thread-safe get*Client methods for lazy-initialization. - Removed redundant Close() calls in individual API methods to maintain persistent connections. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Implement lazy-initialization and caching for GCP clients across all API packages. - Fix GitHub CI by using --snapshot in GoReleaser for pull requests. Initializing a new GCP client for every API call is expensive due to credential discovery and connection handshakes. By caching and reusing the clients within each GCPClient struct, we significantly reduce latency and redundant authentication, particularly during concurrent regional requests. The GoReleaser fix prevents 'git tag was not made against commit' errors in pull requests by using snapshot mode. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Implement lazy-initialization and caching for GCP clients across all API packages to significantly reduce latency and redundant authentication, especially for multi-regional operations.
PR created automatically by Jules for task 2076069182797942206 started by @JulienBreux