Skip to content

Commit

Permalink
[apache#1794] improvement(netty): TransportClientFactory should check…
Browse files Browse the repository at this point in the history
… whether handler is null when creating client (apache#1795)

### What changes were proposed in this pull request?

`TransportClientFactory` should check whether `handler` is `null` when creating client.

### Why are the changes needed?

For: apache#1794.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing UTs.
  • Loading branch information
rickyma authored Jun 15, 2024
1 parent be46a03 commit 69f4393
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ public TransportClient createClient(
// this code was able to update things.
TransportChannelHandler handler =
cachedClient.getChannel().pipeline().get(TransportChannelHandler.class);
synchronized (handler) {
handler.getResponseHandler().updateTimeOfLastRequest();
if (handler != null) {
synchronized (handler) {
handler.getResponseHandler().updateTimeOfLastRequest();
}
}

if (cachedClient.isActive()) {
Expand Down

0 comments on commit 69f4393

Please sign in to comment.