-
Notifications
You must be signed in to change notification settings - Fork 119
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
Some events should not be deferrable #740
Comments
We already have code that actions cannot be deferred, we can probably use
the same errors in this situation.
…On Thu, Apr 21, 2022 at 12:13 PM Pen Gale ***@***.***> wrote:
When Juju is tearing down a unit, deferring does not work as one might
naively expect. Since the controller does not have a view of "deferred" or
"non deferred" events, the controller will simply assume that the
"deferred" hook finished, and will continue the teardown.
When charm authors call event.defer on events like storage-detached, and
possibly relation-departed and relation-broken, the framework should
raise an error.
Error states *are* visible in the controller. This means that the code
will do what the charm author probably "intended", which is to block the
teardown until something else happens.
—
Reply to this email directly, view it on GitHub
<#740>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABRQ7NYBCK7UBLQEP6KL73VGF5BDANCNFSM5T7XVM2Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Excellent. Writing less code is always good :-) |
Events like |
This is still an issue. However, we're thinking of (maybe!) deprecating defer in general, see #966 |
This was done in #1122, and I missed linking the PR to the ticket, sorry 😞. |
When Juju is tearing down a unit, deferring does not work as one might naively expect. Since the controller does not have a view of "deferred" or "non deferred" events, the controller will simply assume that the "deferred" hook finished, and will continue the teardown.
When charm authors call event.defer on events like
storage-detached
, and possiblyrelation-departed
andrelation-broken
, the framework should raise an error.Error states are visible in the controller. This means that the code will do what the charm author probably "intended", which is to block the teardown until something else happens.
The text was updated successfully, but these errors were encountered: