server: fix semaphore release #6737
Merged
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.
This is to fix a bug in v1.57.1 where servers will run very sluggishly, and also take ages to shut down.
The acquire and release functions should have opposite impacts on the count.
Credit to @colega who spotted the diff.
This was introduced in #6706, a backport of #6703, where the line is correct.
https://github.com/grpc/grpc-go/pull/6703/files#diff-366e46a40f6f60b4f7614eb0976bb51820364bf5ca6ccc4787eb49d7bdbef3e6R2098
Also correct in the 1.56 backport: https://github.com/grpc/grpc-go/pull/6708/files#diff-366e46a40f6f60b4f7614eb0976bb51820364bf5ca6ccc4787eb49d7bdbef3e6R2073
RELEASE NOTES: n/a