abciClient.BeginBlockSync should not hang on crashed server (#1891)

* Add test showing normal Sync call

* Show hanging response if server dies during BeginBlock

* Flush all in-flight requests on shutdown, not just pending requests

* Add bugfix to CHANGELOG
This commit is contained in:
Ethan Frey
2018-07-11 07:59:16 +02:00
committed by Anton Kaliaev
parent b980ef8bea
commit f9ae7730fe
3 changed files with 108 additions and 0 deletions

View File

@ -357,6 +357,13 @@ func (cli *socketClient) queueRequest(req *types.Request) *ReqRes {
}
func (cli *socketClient) flushQueue() {
// mark all in-flight messages as resolved (they will get cli.Error())
for req := cli.reqSent.Front(); req != nil; req = req.Next() {
reqres := req.Value.(*ReqRes)
reqres.Done()
}
// mark all queued messages as resolved
LOOP:
for {
select {