File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
modules/elasticsearch/src/main/java/org/elasticsearch/transport/netty Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ ThreadPool threadPool() {
324
324
for (Iterator <NodeChannels > it = connectedNodes .values ().iterator (); it .hasNext ();) {
325
325
NodeChannels nodeChannels = it .next ();
326
326
it .remove ();
327
- nodeChannels .close ();
327
+ nodeChannels .closeAndWait ();
328
328
}
329
329
330
330
if (clientBootstrap != null ) {
@@ -615,5 +615,23 @@ private void closeChannels(Channel[] channels) {
615
615
}
616
616
}
617
617
}
618
+
619
+ public void closeAndWait () {
620
+ closeChannelsAndWait (low );
621
+ closeChannelsAndWait (med );
622
+ closeChannelsAndWait (high );
623
+ }
624
+
625
+ private void closeChannelsAndWait (Channel [] channels ) {
626
+ for (Channel channel : channels ) {
627
+ try {
628
+ if (channel != null && channel .isOpen ()) {
629
+ channel .close ().awaitUninterruptibly ();
630
+ }
631
+ } catch (Exception e ) {
632
+ //ignore
633
+ }
634
+ }
635
+ }
618
636
}
619
637
}
You can’t perform that action at this time.
0 commit comments