Skip to content
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: 6 additions & 2 deletions mysql_ch_replicator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ def restart_dead_process_if_required(self):
logger.warning(f'Restarting stopped process: < {self.cmd} >')
self.run()
return

res = self.process.poll()
if res is None:
# still running
# Process is running fine.
return
logger.warning(f'Restarting dead process: < {self.cmd} >')

logger.warning(f'Process dead (exit code: {res}), restarting: < {self.cmd} >')
# Process has already terminated, just reap it
self.process.wait()
self.run()

def stop(self):
Expand Down