File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
opengrok-indexer/src/main/java/org/opengrok/indexer
opengrok-web/src/main/java/org/opengrok/web Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,15 @@ private ExecutorService newSearchExecutor() {
203203 });
204204 }
205205
206+ public void shutdownSearchExecutor () {
207+ getSearchExecutor ().shutdownNow ();
208+ try {
209+ getSearchExecutor ().awaitTermination (getIndexerCommandTimeout (), TimeUnit .SECONDS );
210+ } catch (InterruptedException e ) {
211+ LOGGER .log (Level .WARNING , "failed to await shutdown of search executor" , e );
212+ }
213+ }
214+
206215 public ExecutorService getRevisionExecutor () {
207216 return lzRevisionExecutor .get ();
208217 }
Original file line number Diff line number Diff line change @@ -413,7 +413,7 @@ public static void main(String[] argv) {
413413 System .err .println ("Exception: " + e .getLocalizedMessage ());
414414 System .exit (1 );
415415 } finally {
416- env .getSearchExecutor (). shutdownNow ();
416+ env .shutdownSearchExecutor ();
417417 stats .report (LOGGER , "Indexer finished" , "indexer.total" );
418418 }
419419 }
Original file line number Diff line number Diff line change 1818 */
1919
2020/*
21- * Copyright (c) 2007, 2021 , Oracle and/or its affiliates. All rights reserved.
21+ * Copyright (c) 2007, 2022 , Oracle and/or its affiliates. All rights reserved.
2222 * Portions Copyright (c) 2018, 2019, Chris Fraire <cfraire@me.com>.
2323 */
2424package org .opengrok .web ;
@@ -167,6 +167,7 @@ public void contextDestroyed(final ServletContextEvent servletContextEvent) {
167167 env .stopExpirationTimer ();
168168 try {
169169 env .shutdownRevisionExecutor ();
170+ env .shutdownSearchExecutor ();
170171 } catch (InterruptedException e ) {
171172 LOGGER .log (Level .WARNING , "Could not shutdown revision executor" , e );
172173 }
You can’t perform that action at this time.
0 commit comments