Fix carbonserver Stat() from resetting the value of max-inflight-requests to zero #497
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.
👋 I am not sure the best process for contributing fixes, but figured I would open a PR instead of a github issue since the fix here is a 1 line change.
It appears that the
max-inflight-requests
configuration is broken. The configuration gets set correctly, but the first time the stats collector runs it gets unset. This confused me when verifying how this configuration option behaves during some load testing to releasing this configuration to our production go-carbon deployment.(my testing was done using the v0.16.2 tag, however the issue appears to still be in the HEAD of
master
as well).This can be observed by adding a logger call right before https://github.com/go-graphite/go-carbon/blob/v0.16.2/carbonserver/carbonserver.go#L1561 to print the value of
listener.MaxInflightRequests
. When running go-carbon built with that extra logger, and then performing a request once every 2-3 seconds, we can see the value oflistener.MaxInflightRequests
reset to zero after the stats collector runsThis appears to be a mis-use of
sender
notsenderRaw
within the CarbonServerListener's Stat function. Changing to senderRaw fixes things: