Savanna sometimes reports wrong cluster status in logs
Bug #1262347 reported by
Andrew Lazarev
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Sahara |
Fix Released
|
Medium
|
Andrew Lazarev |
Bug Description
If error occurs Savanna reports "Cluster status has been changed: id=%s, New status=%s" where new status is sometimes the status Savanna had before. This happens because "conductor.
Changed in savanna: | |
status: | Fix Committed → Fix Released |
Changed in sahara: | |
milestone: | icehouse-2 → 2014.1 |
To post a comment you must log in.
I knew of the problem before and I have an idea on how to fix it. Throughout the code we have the following pattern everywhere:
cluster = conductor. cluster_ update( ctx, cluster, {"status": "Adding Instances"}) g.format_ cluster_ status( cluster) )
LOG.info(
If we just extract it to a single method of the cluster object:
class Cluster(object)
...
def update_status(self, status) cluster = conductor. cluster_ update( ctx, self, {"status": "Adding Instances"}) info(g. format_ cluster_ status( updated_ cluster) )
updated_
LOG.
return updated_cluster
we can later reuse it everywhere and thus avoid the issue. Pretty obvious refactoring, I guess, but there is one thing: when I discussed that with Sergey Lukjanov that last time (couple month ago, I believe), he was concerned with placing code changing the object inside the object itself (or it was something else, I don't remember exactly).
So it might worth checking with Sergey before trying to implement my proposal. Anyway, if you feel you have enough time to fix it soon, feel free to assign bug to yourself.