From 89074a14b6ffa11aa754c8af7429364b733fe41e Mon Sep 17 00:00:00 2001 From: isluckys <152280768+isluckys@users.noreply.github.com> Date: Wed, 29 May 2024 05:31:48 +0800 Subject: [PATCH] Fix udp goroutine leak v.conn.link.Reader is a pipe.Reader, doesn't implement Close(), it will fail assertion and cause the pipe to be left open It can be fixed by using Interrupt() --- transport/internet/udp/dispatcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/internet/udp/dispatcher.go b/transport/internet/udp/dispatcher.go index c29d4b13..9685213b 100644 --- a/transport/internet/udp/dispatcher.go +++ b/transport/internet/udp/dispatcher.go @@ -45,7 +45,7 @@ func (v *Dispatcher) RemoveRay() { v.Lock() defer v.Unlock() if v.conn != nil { - common.Close(v.conn.link.Reader) + common.Interrupt(v.conn.link.Reader) common.Close(v.conn.link.Writer) v.conn = nil }