This repository was archived by the owner on May 27, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +11
-6
lines changed
cakeshop-api/src/main/java/com/jpmorgan/cakeshop Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public void init() {
8181 }
8282
8383 public void shutdown () {
84- LOG .debug ( "shutdown " + getId ());
84+ LOG .info ( "Stopping BlockScanner (thread id= " + getId () + ")" );
8585 this .stopped = true ;
8686 synchronized (wakeup ) {
8787 this .wakeup .notify ();
Original file line number Diff line number Diff line change @@ -100,10 +100,14 @@ private void startThread() {
100100 @ PreDestroy
101101 @ Override
102102 public void shutdown () {
103+ LOG .info ("Stopping MetricsBlockListener (thread id=" + metricCollector .getId () + ")" );
103104 LOG .debug ("shutdown" + metricCollector .getId ());
104105 if (this .metricCollector != null && this .metricCollector .isAlive ()) {
105106 this .metricCollector .running = false ;
106- this .metricCollector .interrupt ();
107+ try {
108+ this .metricCollector .join ();
109+ } catch (InterruptedException e ) {
110+ }
107111 }
108112 }
109113
Original file line number Diff line number Diff line change @@ -95,9 +95,8 @@ protected void init() {
9595 @ PreDestroy
9696 @ Override
9797 public void shutdown () {
98- LOG .debug ( "shutdown " + blockSaver .getId ());
98+ LOG .info ( "Stopping SavingBlockListener (thread id= " + blockSaver .getId () + ")" );
9999 blockSaver .running = false ;
100- blockSaver .interrupt ();
101100 }
102101
103102 protected void saveBlock (Block block ) {
Original file line number Diff line number Diff line change @@ -284,15 +284,17 @@ protected void autoStop() {
284284 deletePid ();
285285
286286 // stop solc server
287+ LOG .info ("Stopping solc daemon" );
287288 List <String > args = Lists .newArrayList (
288289 gethConfig .getNodePath (),
289290 gethConfig .getSolcPath (),
290291 "--stop-ipc" );
291292
292293 ProcessBuilder builder = ProcessUtils .createProcessBuilder (gethConfig , args );
293294 try {
294- builder .start ();
295- } catch (IOException e ) {
295+ Process proc = builder .start ();
296+ proc .waitFor ();
297+ } catch (IOException | InterruptedException e ) {
296298 }
297299 }
298300
You can’t perform that action at this time.
0 commit comments