Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected void sendResponse(int rc, Object response, OpStatsLogger statsLogger)
final long writeNanos = MathUtils.nowInNano();

final long timeOut = requestProcessor.getWaitTimeoutOnBackpressureMillis();
if (timeOut >= 0 && !channel.isWritable()) {
if (timeOut > 0 && !channel.isWritable()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timeout is 0 should fail immediately, it is expected.

Copy link
Copy Markdown
Contributor Author

@gaozhangmin gaozhangmin Nov 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok when timeout is 0 and blacklistedChannels = Optional.empty() ? @zymap @hangc0276

if (waitTimeoutOnBackpressureMillis > 0) {
blacklistedChannels = Optional.of(CacheBuilder.newBuilder()
.expireAfterWrite(waitTimeoutOnBackpressureMillis, TimeUnit.MILLISECONDS)
.build());
} else {
blacklistedChannels = Optional.empty();
}

if (!requestProcessor.isBlacklisted(channel)) {
synchronized (channel) {
if (!channel.isWritable() && !requestProcessor.isBlacklisted(channel)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected void sendResponse(StatusCode code, Object response, OpStatsLogger stat
final long writeNanos = MathUtils.nowInNano();

final long timeOut = requestProcessor.getWaitTimeoutOnBackpressureMillis();
if (timeOut >= 0 && !channel.isWritable()) {
if (timeOut > 0 && !channel.isWritable()) {
if (!requestProcessor.isBlacklisted(channel)) {
synchronized (channel) {
if (!channel.isWritable() && !requestProcessor.isBlacklisted(channel)) {
Expand Down