|
@@ -25,6 +25,7 @@ import (
|
|
|
"net/url"
|
|
"net/url"
|
|
|
"path"
|
|
"path"
|
|
|
"sync"
|
|
"sync"
|
|
|
|
|
+ "time"
|
|
|
|
|
|
|
|
"github.com/coreos/etcd/raft"
|
|
"github.com/coreos/etcd/raft"
|
|
|
)
|
|
)
|
|
@@ -77,6 +78,9 @@ func (h *peerHub) stop() {
|
|
|
for _, p := range h.peers {
|
|
for _, p := range h.peers {
|
|
|
p.stop()
|
|
p.stop()
|
|
|
}
|
|
}
|
|
|
|
|
+ // http.Transport needs some time to put used connections
|
|
|
|
|
+ // into idle queues.
|
|
|
|
|
+ time.Sleep(time.Millisecond)
|
|
|
tr := h.c.Transport.(*http.Transport)
|
|
tr := h.c.Transport.(*http.Transport)
|
|
|
tr.CloseIdleConnections()
|
|
tr.CloseIdleConnections()
|
|
|
}
|
|
}
|