From a561814089d667104b0a329a63a73decf16a5cfc Mon Sep 17 00:00:00 2001 From: "wangdong.attleewang" Date: Mon, 9 Sep 2024 21:17:40 +0800 Subject: [PATCH] fix: Prevent calling the main process exit without WithOnClose() --- pkg/stub/stub.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/stub/stub.go b/pkg/stub/stub.go index 88fd2e18..ed1e9c8a 100644 --- a/pkg/stub/stub.go +++ b/pkg/stub/stub.go @@ -23,6 +23,7 @@ import ( stdnet "net" "os" "path/filepath" + "runtime" "strconv" "sync" "time" @@ -543,7 +544,7 @@ func (stub *stub) connClosed() { return } - os.Exit(0) + runtime.Goexit() //The exit code can be determined when the coroutine exits } //