Skip to content

Commit 49114f6

Browse files
wangdong.attleewangattlee-wang
wangdong.attleewang
authored andcommitted
fix: Prevent calling the main process exit without WithOnClose()
Signed-off-by: attlee-wang <[email protected]>
1 parent 53760d4 commit 49114f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/stub/stub.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
stdnet "net"
2424
"os"
2525
"path/filepath"
26+
"runtime"
2627
"strconv"
2728
"sync"
2829
"time"
@@ -543,7 +544,7 @@ func (stub *stub) connClosed() {
543544
return
544545
}
545546

546-
os.Exit(0)
547+
runtime.Goexit() //The exit code can be determined when the coroutine exits
547548
}
548549

549550
//

0 commit comments

Comments
 (0)