Netty: Close idle tcp connections between controller instances
Change-Id: Ieb6fddce85f015c64e5f0276f0d361a3a93b8fb4
Showing
1 changed file
with
4 additions
and
1 deletions
... | @@ -117,9 +117,11 @@ public class NettyMessaging implements MessagingService { | ... | @@ -117,9 +117,11 @@ public class NettyMessaging implements MessagingService { |
117 | return; | 117 | return; |
118 | } | 118 | } |
119 | this.localEp = localEp; | 119 | this.localEp = localEp; |
120 | - channels.setLifo(false); | 120 | + channels.setLifo(true); |
121 | channels.setTestOnBorrow(true); | 121 | channels.setTestOnBorrow(true); |
122 | channels.setTestOnReturn(true); | 122 | channels.setTestOnReturn(true); |
123 | + channels.setMinEvictableIdleTimeMillis(60_000L); | ||
124 | + channels.setTimeBetweenEvictionRunsMillis(30_000L); | ||
123 | initEventLoopGroup(); | 125 | initEventLoopGroup(); |
124 | startAcceptingConnections(); | 126 | startAcceptingConnections(); |
125 | started.set(true); | 127 | started.set(true); |
... | @@ -265,6 +267,7 @@ public class NettyMessaging implements MessagingService { | ... | @@ -265,6 +267,7 @@ public class NettyMessaging implements MessagingService { |
265 | 267 | ||
266 | @Override | 268 | @Override |
267 | public void destroyObject(Endpoint ep, Channel channel) throws Exception { | 269 | public void destroyObject(Endpoint ep, Channel channel) throws Exception { |
270 | + log.info("Closing connection to {}", ep); | ||
268 | channel.close(); | 271 | channel.close(); |
269 | } | 272 | } |
270 | 273 | ... | ... |
-
Please register or login to post a comment