mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix the daemon panic on consul server restart
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
This commit is contained in:
parent
2509014be8
commit
4df4ba70ca
1 changed files with 7 additions and 0 deletions
|
@ -265,6 +265,13 @@ func (ds *datastore) Watch(kvObject KVObject, stopCh <-chan struct{}) (<-chan KV
|
||||||
close(sCh)
|
close(sCh)
|
||||||
return
|
return
|
||||||
case kvPair := <-kvpCh:
|
case kvPair := <-kvpCh:
|
||||||
|
// If the backend KV store gets reset libkv's go routine
|
||||||
|
// for the watch can exit resulting in a nil value in
|
||||||
|
// channel.
|
||||||
|
if kvPair == nil {
|
||||||
|
close(sCh)
|
||||||
|
return
|
||||||
|
}
|
||||||
dstO := ctor.New()
|
dstO := ctor.New()
|
||||||
|
|
||||||
if err := dstO.SetValue(kvPair.Value); err != nil {
|
if err := dstO.SetValue(kvPair.Value); err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue