[RFE] hook to run checks before departing relations

Bug #1884475 reported by Hemanth Nakkina
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

This is a RFE (Request for Enhancement) for Juju.

Request for a new hook before departing all the relations for remove-unit execution.
This hook will provide the ability to do some application level checks when the application
is stable and block the removal of unit if the checks fail.

One of the use case:
remove-unit of nova-compute (in openstack) requires to check if any instances
are running on that compute node and delete the service from compute service
list. If in case, instances are running, remove-unit should be blocked.
This cannot be achieved in stop/remove hook since the application is not in
stable state.
(The relations are broken and application configurations are modified)

Similar discussion on Discourse (see last comment by enzoaguado Jun 11 on https://discourse.juju.is/t/relation-broken-hook-not-running-in-peers-relation/3212)

tags: added: sts
Revision history for this message
Felipe Reyes (freyes) wrote :

This issue became a need due to the bug 1873521

Revision history for this message
Pen Gale (pengale) wrote :

I'm a little bit cautious about the solution proposed here, as it seems like it might make it difficult to get rid of a stalled out charm, and also allow charm authors to unwittingly get themselves into a deadlock situation.

But the problem is legitimate, and it's worth thinking through a solution.

Changed in juju:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Dominique Poulain (dominique-poulain) wrote :

Thanks for triaging and reviewing Pete.

I understand and agree with the need for caution in the implementation. That said, I feel that in practice, the risk of charm authors getting themselves in trouble with the proposed new hook should more or less be the same as that presented by any other, existing one - unless I am missing something there need not be anything intrinsically riskier in the new hook. If charm authors don't use it, it will be a no-op, and, if they do and get themselves in trouble, it can be skipped, or you can force remove the unit, if need be.

Thoughts?

Revision history for this message
John A Meinel (jameinel) wrote :

Is this a request for "relation-departing" (eg, let me know that my unit is being removed before it has been pulled down to no-longer-in-the-relation), or is this a different request (given the ability to block remove-unit entirely this sounds different).

Also, communicating that this has been blocked sounds difficult given the asynchronous nature of things like "juju remove-unit". (The request sounds like you'd want to make remove-unit synchronous with running this hook so that you can communicated that your request has been denied.)

Revision history for this message
Hemanth Nakkina (hemanth-n) wrote :

This is not a request for "relation-departing".

The RFE is more like defining a new hook at the start of unit's destruction sequence. As a charm author, this new hook can be used to implement logic to perform some application specific checks to continue/block the destruction sequence.
( It is not possible to do the application specific checks in stop hook which executes at end of unit's destruction sequence because by that time the relations are broken and hence the application itself is broken )

Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Wishlist → Low
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.