Merge ~stub/prometheus-charm:setactive into prometheus-charm:master

Proposed by Stuart Bishop
Status: Merged
Merged at revision: 1527db388f64e62df22abceca4c9b8319318e1be
Proposed branch: ~stub/prometheus-charm:setactive
Merge into: prometheus-charm:master
Diff against target: 12 lines (+1/-0)
1 file modified
reactive/prometheus.py (+1/-0)
Reviewer Review Type Date Requested Status
Jacek Nykis (community) Approve
Review via email: mp+318338@code.launchpad.net

Description of the change

Set active workload state after reload

Active workload state was only being set after a restart, which
caused the unit to remain in maintenance states if only a reload
was needed to complete the operation. Addresses lp:1668142

The alternative would be a new set_active handler that kicks in when all relevant state is set/unset. Which works better in complex charms, but I don't think we are there yet.

To post a comment you must log in.
Revision history for this message
Jacek Nykis (jacekn) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/reactive/prometheus.py b/reactive/prometheus.py
2index 5cfbef6..d870d5d 100644
3--- a/reactive/prometheus.py
4+++ b/reactive/prometheus.py
5@@ -386,6 +386,7 @@ def reload_prometheus():
6 # Use SIGHUP to reload config gracefully
7 subprocess.check_call(['killall', '-HUP', 'prometheus'])
8 remove_state('prometheus.do-reload')
9+ hookenv.status_set('active', 'Ready')
10 else:
11 # Let's make sure prometheus is up
12 set_state('prometheus.do-restart')

Subscribers

People subscribed via source and target branches