Skip to content

Commit

Permalink
Always shutdown worker thread pool (#965)
Browse files Browse the repository at this point in the history
With this commit we ensure that the worker's thread pool is always
shutdown when its correspdonding actor exits. We also emit an additional
log message after the pool has been shutdown to clearly indicate that
the actor is exiting now.
  • Loading branch information
danielmitterdorfer authored Apr 16, 2020
1 parent fe57c24 commit 49bea0d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions esrally/driver/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,10 +844,11 @@ def receiveMsg_WakeupMessage(self, msg, sender):
self.wakeupAfter(datetime.timedelta(seconds=self.wakeup_interval))

def receiveMsg_ActorExitRequest(self, msg, sender):
self.logger.info("Worker[%s] is exiting due to ActorExitRequest.", str(self.worker_id))
self.logger.info("Worker[%s] has received ActorExitRequest.", str(self.worker_id))
if self.executor_future is not None and self.executor_future.running():
self.cancel.set()
self.pool.shutdown()
self.pool.shutdown()
self.logger.info("Worker[%s] is exiting due to ActorExitRequest.", str(self.worker_id))

def receiveMsg_BenchmarkFailure(self, msg, sender):
# sent by our no_retry infrastructure; forward to master
Expand Down

0 comments on commit 49bea0d

Please sign in to comment.