|
1 | 1 | /*******************************************************************************
|
2 |
| - * Copyright (c) 2021, 2022 IBM Corporation and others. |
| 2 | + * Copyright (c) 2021, 2025 IBM Corporation and others. |
3 | 3 | * All rights reserved. This program and the accompanying materials
|
4 | 4 | * are made available under the terms of the Eclipse Public License 2.0
|
5 | 5 | * which accompanies this distribution, and is available at
|
|
14 | 14 | import com.ibm.websphere.ras.Tr;
|
15 | 15 | import com.ibm.websphere.ras.TraceComponent;
|
16 | 16 |
|
| 17 | +import io.netty.channel.Channel; |
17 | 18 | import io.netty.channel.ChannelHandler.Sharable;
|
18 | 19 | import io.netty.channel.ChannelHandlerContext;
|
19 | 20 | import io.netty.channel.ChannelInboundHandlerAdapter;
|
@@ -47,6 +48,15 @@ public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
47 | 48 | long currentTime = System.currentTimeMillis();
|
48 | 49 | if (currentTime > (lastConnExceededTime + 600000L)) {
|
49 | 50 | String channelName = ctx.channel().attr(ConfigConstants.NAME_KEY).get();
|
| 51 | + |
| 52 | + // If the channelName is null check the parent for a name. |
| 53 | + if (channelName == null) { |
| 54 | + Channel parentChannel = ctx.channel().parent(); |
| 55 | + if (parentChannel != null) { |
| 56 | + channelName = parentChannel.attr(ConfigConstants.NAME_KEY).get(); |
| 57 | + } |
| 58 | + } |
| 59 | + |
50 | 60 | Tr.warning(tc, TCPMessageConstants.MAX_CONNS_EXCEEDED, channelName, maxConnections);
|
51 | 61 | lastConnExceededTime = currentTime;
|
52 | 62 | }
|
|
0 commit comments