Skip to content

Commit d8f1d8e

Browse files
authored
catch timeout and ops exceptions for failed bootstrap cleanup (#592)
1 parent 5a4e0d9 commit d8f1d8e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/charm.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
from charms.rolling_ops.v0.rollingops import RollingOpsManager
5151
from charms.tempo_coordinator_k8s.v0.charm_tracing import trace_charm
5252
from charms.tempo_coordinator_k8s.v0.tracing import TracingEndpointRequirer
53-
from ops import EventBase, RelationBrokenEvent, RelationCreatedEvent
53+
from ops import EventBase, ModelError, RelationBrokenEvent, RelationCreatedEvent
5454
from ops.charm import RelationChangedEvent, UpdateStatusEvent
5555
from ops.model import (
5656
ActiveStatus,
@@ -60,7 +60,7 @@
6060
Unit,
6161
WaitingStatus,
6262
)
63-
from ops.pebble import Layer
63+
from ops.pebble import ChangeError, Layer
6464
from tenacity import RetryError, Retrying, stop_after_attempt, wait_fixed
6565

6666
from config import CharmConfig, MySQLConfig
@@ -703,6 +703,9 @@ def _configure_instance(self, container) -> None:
703703
MySQLServiceNotRunningError,
704704
MySQLConfigureMySQLUsersError,
705705
MySQLConfigureInstanceError,
706+
ChangeError,
707+
TimeoutError,
708+
ModelError,
706709
):
707710
# On any error, reset the data directory so hook is retried
708711
# on empty data directory

0 commit comments

Comments
 (0)