Skip to content

Commit

Permalink
Merge #3529 into 2.0.0-M4
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Dec 2, 2024
2 parents f3aba9b + 864474a commit 5cc34b2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,7 @@ final class RequestTimeoutTask implements Runnable {
@Override
public void run() {
if (!requestAvailable) {
ctx.fireChannelInboundEvent(RequestTimeoutException.INSTANCE);
ctx.fireChannelInboundEvent(RequestTimeoutException.requestTimedOut());
ctx.close();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ final class RequestTimeoutTask implements Runnable {
@Override
public void run() {
if (ctx.channel().isActive() && !(isInboundCancelled() || isInboundDisposed())) {
onInboundError(RequestTimeoutException.INSTANCE);
onInboundError(RequestTimeoutException.requestTimedOut());
ctx.close();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2023-2024 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,17 +18,20 @@
import io.netty5.channel.ChannelException;

final class RequestTimeoutException extends ChannelException {

static final RequestTimeoutException INSTANCE = new RequestTimeoutException();
static final String REQUEST_TIMED_OUT = "Request timed out";

private static final long serialVersionUID = 422626851161276356L;

RequestTimeoutException() {
super(null, null, true);
RequestTimeoutException(String message) {
super(message);
}

@Override
public synchronized Throwable fillInStackTrace() {
return this;
}

static RequestTimeoutException requestTimedOut() {
return new RequestTimeoutException(REQUEST_TIMED_OUT);
}
}

0 comments on commit 5cc34b2

Please sign in to comment.