Merge "Log db sync failures during retry" into main
This commit is contained in:
commit
7970a9171c
@ -675,8 +675,12 @@ class OSBaseOperatorCharmK8S(OSBaseOperatorCharm):
|
||||
def _retry_db_sync(self, cmd):
|
||||
container = self.unit.get_container(self.db_sync_container_name)
|
||||
logging.debug("Running sync: \n%s", cmd)
|
||||
try:
|
||||
process = container.exec(cmd, timeout=5 * 60)
|
||||
out, err = process.wait_output()
|
||||
except ops.pebble.ExecError as e:
|
||||
logger.warning(f"DB Sync pebble exec error: {str(e)}")
|
||||
raise e
|
||||
if err:
|
||||
for line in err.splitlines():
|
||||
logger.warning("DB Sync stderr: %s", line.strip())
|
||||
|
Loading…
Reference in New Issue
Block a user