Skip to content

Conversation

@meiji163
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 18, 2025 05:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds an environment-driven bypass mode to the HTTP API, allowing throttle checks to be skipped when FRENO_BYPASS_ENABLED is set.

  • Introduces bypassEnabled field on APIImpl and reads it from FRENO_BYPASS_ENABLED.
  • Short-circuits check handler to always return HTTP 200 when bypass is enabled.
Comments suppressed due to low confidence (2)

pkg/http/api.go:65

  • Add a comment above this field explaining that when true, throttle checks are bypassed to clarify its purpose in the API behavior.
	bypassEnabled    bool

pkg/http/api.go:171

  • Add unit tests for the bypass path to verify that throttle checks are correctly short-circuited and return HTTP 200 when bypass is enabled.
	if api.bypassEnabled {

}
if len(totalHosts) == 0 {
if throttler.BypassOnNoHostsFound {
log.Debugf("No hosts for pool: %+v, but bypass is enabled", poolName)
Copy link
Member

Choose a reason for hiding this comment

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

Do we get a stat counter?

Choose a reason for hiding this comment

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

metrics.GetOrRegisterCounter("<name>", nil).Inc(1)

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.

4 participants