소스 검색

Fix negative WaitGroup counter panic

Rod Hynes 8 년 전
부모
커밋
8c838d4423
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      psiphon/common/tun/tun.go

+ 4 - 2
psiphon/common/tun/tun.go

@@ -629,7 +629,9 @@ func (server *Server) runOrphanMetricsCheckpointer() {
 
 func (server *Server) runDeviceDownstream() {
 
-	defer server.workers.Done()
+	// TODO: this is a hack workaround for the issue documented in
+	// Server.Start().
+	//defer server.workers.Done()
 
 	// Read incoming packets from the tun device, parse and validate the
 	// packets, map them to a session/client, perform rewriting, and relay
@@ -1561,7 +1563,7 @@ func (client *Client) Start() {
 	//
 	//client.workers.Add(1)
 	go func() {
-		defer client.workers.Done()
+		//defer client.workers.Done()
 		for {
 			readPacket, err := client.device.ReadPacket()