File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/main/java/org/xbib/elasticsearch/plugin/jdbc Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -119,10 +119,8 @@ public P get() {
119119 for (RiverPipeline pipeline : pipelines ) {
120120 pipeline .setInterrupted (true );
121121 }
122- if (metricsThread != null ) {
123- logger .debug ("interrupting metrics thread" );
124- metricsThread .interrupt ();
125- }
122+ closeMetricThread ();
123+ closeSuspensionThread ();
126124 Thread .currentThread ().interrupt ();
127125 logger .warn ("interrupted" );
128126 } catch (Throwable t ) {
@@ -141,6 +139,11 @@ protected void afterPipelineExecutions() throws Exception {
141139 if (executor != null ) {
142140 executor .shutdown ();
143141 }
142+ closeMetricThread ();
143+ closeSuspensionThread ();
144+ }
145+
146+ private void closeMetricThread () {
144147 if (metricsThreadPoolExecutor != null ) {
145148 logger .debug ("shutting down metrics thread scheduler" );
146149 metricsThreadPoolExecutor .shutdownNow ();
@@ -149,6 +152,9 @@ protected void afterPipelineExecutions() throws Exception {
149152 if (metricsThread != null ) {
150153 metricsThread .interrupt ();
151154 }
155+ }
156+
157+ private void closeSuspensionThread () {
152158 if (suspensionThreadPoolExecutor != null ) {
153159 logger .debug ("shutting down suspension thread scheduler" );
154160 suspensionThreadPoolExecutor .shutdownNow ();
You can’t perform that action at this time.
0 commit comments