Merge lp:~frankban/juju-gui/bug-1169973-dying-services into lp:juju-gui/experimental

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 572
Proposed branch: lp:~frankban/juju-gui/bug-1169973-dying-services
Merge into: lp:juju-gui/experimental
Diff against target: 0 lines
To merge this branch: bzr merge lp:~frankban/juju-gui/bug-1169973-dying-services
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+159443@code.launchpad.net

Description of the change

Do not hide dying services in an error state

Due to bug 1168154, removing a service in an error state
does not really destroy the service, that will be
eventually destroyed once all its units are resolved.
A dying unit could also fail executing the stop hook,
leaving the service undead in the juju database.
For this reason, we don't wont to hide services in an
erro state, even if they are dying.

QA:
- deploy buildbot-master;
- destroy it;
- wait a second, you should see it return like a
  red zombie.

https://codereview.appspot.com/8835043/

To post a comment you must log in.
Revision history for this message
Francesco Banconi (frankban) wrote :
Download full text (7.2 KiB)

Reviewers: mp+159443_code.launchpad.net,

Message:
Please take a look.

Description:
Do not hide dying services in an error state

Due to bug 1168154, removing a service in an error state
does not really destroy the service, that will be
eventually destroyed once all its units are resolved.
A dying unit could also fail executing the stop hook,
leaving the service undead in the juju database.
For this reason, we don't wont to hide services in an
erro state, even if they are dying.

QA:
- deploy buildbot-master;
- destroy it;
- wait a second, you should see it return like a
   red zombie.

https://code.launchpad.net/~frankban/juju-gui/bug-1169973-dying-services/+merge/159443

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/8835043/

Affected files:
   A [revision details]
   M app/models/models.js
   M app/views/topology/service.js
   M test/test_model.js
   M test/test_service_module.js

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision:
<email address hidden>

Index: test/test_model.js
=== modified file 'test/test_model.js'
--- test/test_model.js 2013-04-17 13:28:40 +0000
+++ test/test_model.js 2013-04-17 15:45:59 +0000
@@ -646,7 +646,7 @@

  describe('service models', function() {
- var models, list, django, rails, mysql;
+ var models, list, django, rails, wordpress, mysql;

    before(function(done) {
      YUI(GlobalConfig).use(['juju-models'], function(Y) {
@@ -657,9 +657,22 @@

    beforeEach(function() {
      django = new models.Service({id: 'django'});
- rails = new models.Service({id: 'rails', life: 'dying'});
- mysql = new models.Service({id: 'mysql', life: 'dead'});
- list = new models.ServiceList({items: [rails, django, mysql]});
+ rails = new models.Service({
+ id: 'rails',
+ life: 'dying',
+ aggregated_status: {}
+ });
+ wordpress = new models.Service({
+ id: 'wordpress',
+ life: 'dying',
+ aggregated_status: {error: 42}
+ });
+ mysql = new models.Service({
+ id: 'mysql',
+ life: 'dead',
+ aggregated_status: {error: 0}
+ });
+ list = new models.ServiceList({items: [rails, django, wordpress,
mysql]});
    });

    it('instances identify if they are alive', function() {
@@ -668,14 +681,25 @@
    });

    it('instances identify if they are not alive (dying or dead)',
function() {
- assert.isFalse(rails.isAlive());
- assert.isFalse(mysql.isAlive());
- });
-
- it('can be filtered so that it returns only alive models', function() {
- var filtered = list.alive();
- assert.strictEqual(1, filtered.size());
- assert.deepEqual([django], filtered.toArray());
+ assert.isFalse(rails.isAlive(), rails.get('id'));
+ assert.isFalse(wordpress.isAlive(), wordpress.get('id'));
+ assert.isFalse(mysql.isAlive(), mysql.get('id'));
+ });
+
+ it('instances identify if they they have errors', function() {
+ assert.isTrue(wordpress.hasEr...

Read more...

Revision history for this message
Gary Poster (gary) wrote :
Revision history for this message
Nicola Larosa (teknico) wrote :

LGTM, one trivial.

https://codereview.appspot.com/8835043/diff/1/test/test_model.js
File test/test_model.js (right):

https://codereview.appspot.com/8835043/diff/1/test/test_model.js#newcode689
test/test_model.js:689: it('instances identify if they they have
errors', function() {
Double "they".

https://codereview.appspot.com/8835043/diff/1/test/test_model.js#newcode693
test/test_model.js:693: it('instances identify if they they do not have
errors', function() {
Double "they".

https://codereview.appspot.com/8835043/

571. By Francesco Banconi

Changes as per review.

572. By Francesco Banconi

Merged trunk.

Revision history for this message
Francesco Banconi (frankban) wrote :

*** Submitted:

Do not hide dying services in an error state

Due to bug 1168154, removing a service in an error state
does not really destroy the service, that will be
eventually destroyed once all its units are resolved.
A dying unit could also fail executing the stop hook,
leaving the service undead in the juju database.
For this reason, we don't wont to hide services in an
erro state, even if they are dying.

QA:
- deploy buildbot-master;
- destroy it;
- wait a second, you should see it return like a
   red zombie.

R=gary.poster, teknico
CC=
https://codereview.appspot.com/8835043

https://codereview.appspot.com/8835043/diff/1/test/test_model.js
File test/test_model.js (right):

https://codereview.appspot.com/8835043/diff/1/test/test_model.js#newcode689
test/test_model.js:689: it('instances identify if they they have
errors', function() {
On 2013/04/18 09:04:02, teknico wrote:
> Double "they".

Done.

https://codereview.appspot.com/8835043/diff/1/test/test_model.js#newcode693
test/test_model.js:693: it('instances identify if they they do not have
errors', function() {
On 2013/04/18 09:04:02, teknico wrote:
> Double "they".

Done.

https://codereview.appspot.com/8835043/

Revision history for this message
Francesco Banconi (frankban) wrote :

Thanks for the reviews Gary and Nicola!

https://codereview.appspot.com/8835043/

Preview Diff

Empty

Subscribers

People subscribed via source and target branches