Skip to content

Commit 0dad0c9

Browse files
Travis PattersonCaitlyn Yu
authored andcommitted
Fix issue where rlp somethimes doesn't stop
- Enforce exit 30 seconds after calling stop for graceful shutdown [#172381656]
1 parent 1095872 commit 0dad0c9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/rlp/main.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,17 @@ func main() {
103103
app.WithMaxEgressStreams(conf.MaxEgressStreams),
104104
)
105105
go rlp.Start()
106-
defer rlp.Stop()
106+
107+
defer func() {
108+
go func() {
109+
// Limit the shutdown to 30 seconds
110+
<-time.Tick(30 * time.Second)
111+
os.Exit(0)
112+
}()
113+
114+
rlp.Stop()
115+
}()
116+
107117
go profiler.New(conf.PProfPort).Start()
108118

109119
killSignal := make(chan os.Signal, 1)

0 commit comments

Comments
 (0)