Skip to content
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

[fix][doc] Fix maxNumberOfRejectedRequestPerConnection doc #17821

Merged

Conversation

coderzc
Copy link
Member

@coderzc coderzc commented Sep 23, 2022

Motivation

The maximum number of rejected requests of a broker in a certain time frame (30 seconds) after the current connection is closed and the client creates a new connection to connect to a different broker.

According to code, the time frame should be in the 60s instead of the 30s, see:

private final int rejectedRequestResetTimeSec = 60;

private void incrementRejectsAndMaybeClose() {
long rejectedRequests = NUMBER_OF_REJECTED_REQUESTS_UPDATER.getAndIncrement(this);
if (rejectedRequests == 0) {
// schedule timer
eventLoopGroup.schedule(() -> NUMBER_OF_REJECTED_REQUESTS_UPDATER.set(ClientCnx.this, 0),
rejectedRequestResetTimeSec, TimeUnit.SECONDS);
} else if (rejectedRequests >= maxNumberOfRejectedRequestPerConnection) {
log.error("{} Close connection because received {} rejected request in {} seconds ", ctx.channel(),
NUMBER_OF_REJECTED_REQUESTS_UPDATER.get(ClientCnx.this), rejectedRequestResetTimeSec);
ctx.close();
}
}

Modifications

30 seconds -> 60seconds

Documentation

  • doc
    (Your PR contains doc changes)

@github-actions github-actions bot added the doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. label Sep 23, 2022
@coderzc
Copy link
Member Author

coderzc commented Sep 26, 2022

@Anonymitaet @momo-jun PTAL

@momo-jun
Copy link
Contributor

@coderzc thanks for maintaining the docs. Can you pls also include the update in 2.8.x docs and invite a peer to review the PR for technical validity?

@coderzc
Copy link
Member Author

coderzc commented Sep 26, 2022

@coderzc thanks for maintaining the docs. Can you pls also include the update in 2.8.x docs and invite a peer to review the PR for technical validity?

I updated it 2.8.x docs.

@momo-jun momo-jun merged commit 26281d5 into apache:master Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Your PR contains doc changes, no matter whether the changes are in markdown or code files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants