Просмотр исходного кода

etcdserver: close idle connections when stop sendhub

Yicheng Qin 11 лет назад
Родитель
Сommit
fa292391d8
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      etcdserver/sendhub.go

+ 3 - 0
etcdserver/sendhub.go

@@ -86,6 +86,9 @@ func (h *sendHub) Stop() {
 	for _, s := range h.senders {
 		s.Stop()
 	}
+	if tr, ok := h.tr.(*http.Transport); ok {
+		tr.CloseIdleConnections()
+	}
 }
 
 func (h *sendHub) ShouldStopNotify() <-chan struct{} {