Skip to content
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

DPE-5493 Skip tls reconfiguration on unit teardown #522

Merged
merged 2 commits into from
Sep 22, 2024

Conversation

paulomach
Copy link
Contributor

Issue

Caught on tests, uncaught exception on unit teardown when related to a TLS operator

Solution

Skip TLS reconfiguration on unit teardown

@@ -174,6 +174,9 @@ def _on_tls_relation_broken(self, _) -> None:
except KeyError:
# ignore key error for unit teardown
pass
if self.charm.removing_unit:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im wondering if it might be a good idea to add this check to all event handlers (or better yet, condition all self.framework.observe statements to ensure no event handlers run if charm is being removed)

to better understand: why are we allowing setting of secrets on lines 170-173 instead of just no-oping the handler entirely

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this check to all event handlers

reconcile charm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, eventually.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to better understand: why are we allowing setting of secrets on lines 170-173 instead of just no-oping the handler entirely

indeed. If unit is going away, so will it's databag keys

@@ -174,6 +174,9 @@ def _on_tls_relation_broken(self, _) -> None:
except KeyError:
# ignore key error for unit teardown
pass
if self.charm.removing_unit:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this check to all event handlers

reconcile charm?

@paulomach paulomach merged commit 9fe60aa into main Sep 22, 2024
101 of 102 checks passed
@paulomach paulomach deleted the fix/skip_tls_reconfiguration branch September 22, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants