fix(gcp auth): OBE-12220 lazy token fetch to prevent startup crash loop - #161
Open
akshayakumar-t wants to merge 2 commits into
Open
akshayakumar-t wants to merge 2 commits into
akshayakumar-t wants to merge 2 commits into
Conversation
Previously GcpAuthenticator::from_file() and new_implicit() fetched an OAuth token eagerly at build time. If credentials were expired when vector (re)started, auth.build() would fail, the entire topology would fail to build, and the process manager would restart vector into a crash loop — taking all sources down, not just the GCP one. With this change, build() only parses/validates credentials (cheap, local). The first token fetch is deferred to the token_regenerator background task which fires immediately on startup and retries on failure. GCP components start in a token-less state and begin working as soon as the background fetch succeeds, without affecting the rest of the topology. Co-Authored-By: Akshaya's Agent <akshaya.kumar+agent@sentinelone.com>
Captures Opus code review findings and AWS auth comparison. Key issues: sink healthcheck races token fetch (HIGH), silent 401 on first HTTP sink request (MEDIUM), dead map_or fallback (MEDIUM). Co-Authored-By: Akshaya's Agent <akshaya.kumar+agent@sentinelone.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previously GcpAuthenticator::from_file() and new_implicit() fetched an OAuth token eagerly at build time. If credentials were expired when vector (re)started, auth.build() would fail, the entire topology would fail to build, and the process manager would restart vector into a crash loop — taking all sources down, not just the GCP one.
With this change, build() only parses/validates credentials (cheap, local). The first token fetch is deferred to the token_regenerator background task which fires immediately on startup and retries on failure. GCP components start in a token-less state and begin working as soon as the background fetch succeeds, without affecting the rest of the topology.