Skip to content

fix: prevent exitChan blocking in websocket mode#399

Open
chenhang233 wants to merge 1 commit intoaceld:masterfrom
chenhang233:fix-exitchan-blocking
Open

fix: prevent exitChan blocking in websocket mode#399
chenhang233 wants to merge 1 commit intoaceld:masterfrom
chenhang233:fix-exitchan-blocking

Conversation

@chenhang233
Copy link
Copy Markdown

通过退出信号试图停止进程,发现一直阻塞到超时.
关闭的 channel 会立即让所有阻塞的 <-ch 操作返回零值. t.exitChan <- struct{}{} 是多余的.

如果只启动websocket模式:
没有 goroutine 在执行 <-s.exitChan
s.exitChan <- struct{}{} 永久阻塞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant