Skip to content

Oplog/Resolver/Resolver.py: De-duplicating code closing the pool #280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions mongodb_consistent_backup/Oplog/Resolver/Resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def __init__(self, manager, config, timer, base_dir, backup_dir, tailed_oplogs,
logging.fatal("Could not start oplog resolver pool! Error: %s" % e)
raise Error(e)

def close(self, code=None, frame=None):
if self._pool and not self.stopped:
def close(self):
if self._pool and self.stopped:
logging.debug("Stopping all oplog resolver threads")
self._pool.terminate()
logging.info("Stopped all oplog resolver threads")
Expand Down Expand Up @@ -102,10 +102,6 @@ def wait(self, max_wait_secs=6 * 3600, poll_secs=2):
waited_secs += poll_secs
else:
raise OperationError("Waited more than %i seconds for Oplog resolver! I will assume there is a problem and exit")
self._pool.terminate()
logging.debug("Stopped all oplog resolver threads")
self.stopped = True
self.running = False

def run(self):
try:
Expand Down