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):
|
def _retry_db_sync(self, cmd):
|
||||||
container = self.unit.get_container(self.db_sync_container_name)
|
container = self.unit.get_container(self.db_sync_container_name)
|
||||||
logging.debug("Running sync: \n%s", cmd)
|
logging.debug("Running sync: \n%s", cmd)
|
||||||
|
try:
|
||||||
process = container.exec(cmd, timeout=5 * 60)
|
process = container.exec(cmd, timeout=5 * 60)
|
||||||
out, err = process.wait_output()
|
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:
|
if err:
|
||||||
for line in err.splitlines():
|
for line in err.splitlines():
|
||||||
logger.warning("DB Sync stderr: %s", line.strip())
|
logger.warning("DB Sync stderr: %s", line.strip())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user