Skip to content

Add bypass #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Add bypass #176

wants to merge 7 commits into from

Conversation

meiji163
Copy link
Contributor

No description provided.

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

@Copilot 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 {

@@ -331,6 +333,10 @@ func (throttler *Throttler) refreshMySQLInventory() error {
}
}
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.

3 participants