Skip to content

Autopudate#115

Merged
aojea merged 6 commits into
google:mainfrom
aojea:autopudate
Jun 15, 2026
Merged

Autopudate#115
aojea merged 6 commits into
google:mainfrom
aojea:autopudate

Conversation

@aojea

@aojea aojea commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 removes obsolete Kubernetes resources and configures GKE Gateway, HTTPRoute, and HealthCheckPolicy for the sam-hub service. It also enforces exact path matching in the hub server, enhances authentication error handling during node initialization, and introduces a safety mechanism to terminate the node if identity renewal fails after expiration. The review feedback correctly identifies a potential busy-spin issue in the renewal loop when the token duration is positive but extremely small, and suggests enforcing a minimum floor of 2 seconds for the renewal interval.

Comment thread cmd/sam-node/node.go
Comment on lines 508 to 512
} else if duration > 0 {
renewAfter = duration / 2
} else {
renewAfter = 1 * time.Minute
renewAfter = 1 * time.Second
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

If duration is positive but very small (e.g., less than a few seconds), renewAfter = duration / 2 will result in extremely small durations (milliseconds or microseconds). This causes the renewal loop to busy-spin and spam the OIDC provider or hub with a rapid succession of requests as the expiration time approaches.

To prevent this, enforce a minimum floor for renewAfter (e.g., 2 seconds) when duration is small.

Suggested change
} else if duration > 0 {
renewAfter = duration / 2
} else {
renewAfter = 1 * time.Minute
renewAfter = 1 * time.Second
}
} else if duration > 4*time.Second {
renewAfter = duration / 2
} else {
renewAfter = 2 * time.Second
}

@aojea aojea merged commit b46fc53 into google:main Jun 15, 2026
10 checks passed
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