@@ -154,8 +154,11 @@ private List<IdleChannel> expiredChannels(ConcurrentLinkedDeque<IdleChannel> par
154
154
// lazy create
155
155
List <IdleChannel > idleTimeoutChannels = null ;
156
156
for (IdleChannel idleChannel : partition ) {
157
- if (isIdleTimeoutExpired (idleChannel , now ) || isRemotelyClosed (idleChannel .channel ) || isTtlExpired (idleChannel .channel , now )) {
158
- LOGGER .debug ("Adding Candidate expired Channel {}" , idleChannel .channel );
157
+ boolean isIdleTimeoutExpired = isIdleTimeoutExpired (idleChannel , now );
158
+ boolean isRemotelyClosed = isRemotelyClosed (idleChannel .channel );
159
+ boolean isTtlExpired = isTtlExpired (idleChannel .channel , now );
160
+ if (isIdleTimeoutExpired || isRemotelyClosed || isTtlExpired ) {
161
+ LOGGER .debug ("Adding Candidate expired Channel {} isIdleTimeoutExpired={} isRemotelyClosed={} isTtlExpired={}" , idleChannel .channel , isIdleTimeoutExpired , isRemotelyClosed , isTtlExpired );
159
162
if (idleTimeoutChannels == null )
160
163
idleTimeoutChannels = new ArrayList <>(1 );
161
164
idleTimeoutChannels .add (idleChannel );
@@ -199,7 +202,10 @@ public void run(Timeout timeout) throws Exception {
199
202
200
203
if (LOGGER .isDebugEnabled ())
201
204
for (Object key : partitions .keySet ()) {
202
- LOGGER .debug ("Entry count for : {} : {}" , key , partitions .get (key ).size ());
205
+ int size = partitions .get (key ).size ();
206
+ if (size > 0 ) {
207
+ LOGGER .debug ("Entry count for : {} : {}" , key , size );
208
+ }
203
209
}
204
210
205
211
long start = unpreciseMillisTime ();
@@ -228,7 +234,9 @@ public void run(Timeout timeout) throws Exception {
228
234
229
235
if (LOGGER .isDebugEnabled ()) {
230
236
long duration = unpreciseMillisTime () - start ;
231
- LOGGER .debug ("Closed {} connections out of {} in {} ms" , closedCount , totalCount , duration );
237
+ if (closedCount > 0 ) {
238
+ LOGGER .debug ("Closed {} connections out of {} in {} ms" , closedCount , totalCount , duration );
239
+ }
232
240
}
233
241
234
242
scheduleNewIdleChannelDetector (timeout .task ());
0 commit comments