Skip to content

fix(gcp auth): OBE-12220 lazy token fetch to prevent startup crash loop - #161

Open
akshayakumar-t wants to merge 2 commits into
masterfrom
OBE-12220__lazy_gcp_auth_token_fetch
Open

akshayakumar-t wants to merge 2 commits into
masterfrom
OBE-12220__lazy_gcp_auth_token_fetch

Conversation

@akshayakumar-t

Copy link
Copy Markdown
Contributor

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.

akshayakumar-t and others added 2 commits September 13, 2026 12:45
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant