-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
server: prohibit more than MaxConcurrentStreams handlers from running at once (#6703) #6706
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
if maxStreams == 0 { | ||
maxStreams = math.MaxUint32 | ||
} else { | ||
if config.MaxStreams != math.MaxUint32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean that it will NOT take effect any more if applications set MaxConcurrentStreams as math.MaxUint32
?
Note the default value set by etcd is math.MaxUint32
, reference:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems OK, since the default maxConcurrentStreams is math.MaxUint32
// concurrent calls to acquire, but also note that with synchronous calls to | ||
// acquire, as our system does, n will never be less than -1. There are | ||
// fairness issues (queuing) to consider if this was to be generalized. | ||
if atomic.AddInt64(&q.n, -1) <= 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suspect this -1
should be 1
.
Spotted by @colega
RELEASE NOTES: