Skip to content

Commit

Permalink
sd/etcdv3: serve the keepalive response channel (#803)
Browse files Browse the repository at this point in the history
read and discard keepalive response,
make etcd library not to complain
fix #799
  • Loading branch information
fangdingjun authored and peterbourgon committed Mar 11, 2019
1 parent aef3868 commit 90f6ad6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sd/etcdv3/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ func (c *client) Register(s Service) error {
return err
}

// discard the keepalive response, make etcd library not to complain
// fix bug #799
go func() {
for {
select {
case <-c.hbch:
case <-c.ctx.Done():
return
}
}
}()

return nil
}

Expand Down

0 comments on commit 90f6ad6

Please sign in to comment.