https://codereview.appspot.com/6250068/diff/5004/cmd/jujud/provisioning.go#newcode37
cmd/jujud/provisioning.go:37: st, err := state.Open(&a.Conf.StateInfo)
On 2012/06/01 01:58:27, dfc wrote:
> > What happens if the connection is broken? We'll need to reestablish
it and
> > restart from the beginning, since all the assumptions are now wrong.
Maybe
> this
> > has to be moved into the outer loop or something. Will leave details
with you
> at
> > this point.
> I looked into this more this morning and it looks like if the
underlying
> connection to ZK is interrupted then the c client reconnects behind
the scenes.
> I tested this by running the PA, then shutting down zk, then starting
it again a
> minute later. None of the watchers exited.
> I'm going to keep playing with this, but at this point, if gozk never
reports an
> error when it cant talk to the zk server, I can't think of a way to
detect
> connection failure.
We've covered this on juju-dev@. A TODO would be good here as well.
https://codereview.appspot.com/6250068/diff/16001/cmd/jujud/provisioning.go#newcode56
cmd/jujud/provisioning.go:56: // environChanges returns a channel that
will receive the new *ConfigNode
As we discussed, that logic can be simplified as we can bubble up onto
the top from any hiccups, rather than retrying in place. I'm happy both
for this branch to be changed to cover that, or for it to be integrated
with these and then refactored. I'll comment in-place and let the
decision with you.
We spent a good while in London fiddling with messages and trying to
imagine how the actual error and log messages look like with prefixes,
and the conclusion we got to is that it doesn't really improve much the
understanding, and that we've been terribly inconsistent so far. The
agreement we're trying to get to (which still accepts input) is being a
bit more clear in the messages themselves.
https:/ /codereview. appspot. com/6250068/ diff/5004/ cmd/jujud/ provisioning. go provisioning. go (right):
File cmd/jujud/
https:/ /codereview. appspot. com/6250068/ diff/5004/ cmd/jujud/ provisioning. go#newcode37 provisioning. go:37: st, err := state.Open( &a.Conf. StateInfo)
cmd/jujud/
On 2012/06/01 01:58:27, dfc wrote:
> > What happens if the connection is broken? We'll need to reestablish
it and
> > restart from the beginning, since all the assumptions are now wrong.
Maybe
> this
> > has to be moved into the outer loop or something. Will leave details
with you
> at
> > this point.
> I looked into this more this morning and it looks like if the
underlying
> connection to ZK is interrupted then the c client reconnects behind
the scenes.
> I tested this by running the PA, then shutting down zk, then starting
it again a
> minute later. None of the watchers exited.
> I'm going to keep playing with this, but at this point, if gozk never
reports an
> error when it cant talk to the zk server, I can't think of a way to
detect
> connection failure.
We've covered this on juju-dev@. A TODO would be good here as well.
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go provisioning. go (right):
File cmd/jujud/
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode56 provisioning. go:56: // environChanges returns a channel that
cmd/jujud/
will receive the new *ConfigNode
As we discussed, that logic can be simplified as we can bubble up onto
the top from any hiccups, rather than retrying in place. I'm happy both
for this branch to be changed to cover that, or for it to be integrated
with these and then refactored. I'll comment in-place and let the
decision with you.
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode57 provisioning. go:57: // when a change is detected.
cmd/jujud/
// when a change in the environment configuration is detected.
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode65 provisioning. go:65: // stopEnvironWatcher stops and
cmd/jujud/
invalidates the current environWatcher.
s/and invalidates//
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode69 provisioning. go:69: log.Printf( "provisioning: environWatcher
cmd/jujud/
reported error on Stop: %v", err)
This is Printf rather than Debugf, so we need to be a bit nicer to the
user (no method and field names). Something like this might do:
"environment configuration watcher: %v"
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode76 provisioning. go:76: // changes returns a channel that will
cmd/jujud/
receive the new *ConfigNode when a
Needs updating.
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode89 provisioning. go:89: log.Printf( "provisioning: machinesWatcehr
cmd/jujud/
reported error on Stop: %v", err)
"machines watcher: %v"
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode107 provisioning. go:107: // TODO(dfc) we need a method like
cmd/jujud/
state.IsValid() here to exit cleanly if
IsConnected?
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode116 provisioning. go:116: continue
cmd/jujud/
This should return an error.. it won't help to continue here. The state
will be broken.
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode121 provisioning. go:121: log.Printf( "provisioner: unable to create
cmd/jujud/
environment from supplied configuration: %v", err)
"provisioner loaded invalid environment configuration: %v"
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode124 provisioning. go:124: log.Printf( "provisioner: valid
cmd/jujud/
environment configured")
"provisioner loaded new environment configuration"
We spent a good while in London fiddling with messages and trying to
imagine how the actual error and log messages look like with prefixes,
and the conclusion we got to is that it doesn't really improve much the
understanding, and that we've been terribly inconsistent so far. The
agreement we're trying to get to (which still accepts input) is being a
bit more clear in the messages themselves.
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode133 provisioning. go:133: // TODO(dfc) we need a method like
cmd/jujud/
state.IsValid() here to exit cleanly if
IsConnected?
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode142 provisioning. go:142: return fmt.Errorf( "environWatcher
cmd/jujud/
closed")
"environment configuration watcher was closed"
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode146 provisioning. go:146: log.Printf( "provisioner: new
cmd/jujud/
configuration received, but was not valid: %v", err)
"provisioner loaded invalid environment configuration: %v"
https:/ /codereview. appspot. com/6250068/ diff/16001/ cmd/jujud/ provisioning. go#newcode150 provisioning. go:150: log.Printf( "provisioner: new environment
cmd/jujud/
configuartion applied")
"provisioner loaded new environment configuration"
https:/ /codereview. appspot. com/6250068/