Repository navigation
fix(backend): make the standard HTTP transport the default - #591
Merged
Merged
Conversation
deniszh
approved these changes
Nov 11, 2026
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.
Why
What issue is this change attempting to solve?
An unset
CARBONAPI_SYNC_BACKEND_HTTPcurrently enables the custom synchronous connection pool. Make Go's standard HTTP transport the default and require an explicit opt-in for the synchronous implementation. Operators can keep using=0to select the standard transport across old and new binaries.Architecture
How does this change solve the problem? Why is this the best approach?
InitBackendsstill constructs one shared HTTP client for the network backends. A small transport constructor preserves the configured idle pool, idle timeout, connect timeout and keepalive, and makes transport selection directly testable. Backend discovery, queues, request budgets and error handling keep their existing boundaries.Only the exact value
1wraps the configured Go transport inSyncTransport. Its HTTPS, proxy and non-GET fallback remains unchanged. The custom implementation is retained for explicit comparisons and diagnosis; this change adds no delta to that implementation. It can be removed once those comparisons no longer need the alternate path.Before / after
01Usage
Normal backend initialization now uses the standard transport without an override:
unset CARBONAPI_SYNC_BACKEND_HTTPFor an explicit synchronous-transport comparison, set
CARBONAPI_SYNC_BACKEND_HTTP=1before starting the process. Keep=0when rolling back to an older binary if the standard transport should remain selected. Both runtime guides describe this behavior.Validation
How can we be sure this works as expected?
0,1,true, another number and whitespace. They were demonstrated to fail against the previous default before applying the behavior change.0and1settings.go test -race ./pkg/app/carbonapi ./pkg/backend/net ./pkg/backend ./pkg/cfgpassed.make testpassed: the complete Cairo/nativegzip/zlibng race suite and the nativegzip and portable backend decoder variants.git diff --checkpassed.