Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new method -- ReleaseWaitAllWorkersExit() for waiting all worke… #245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cuishuang
Copy link

fix issue #244

…rs to exit

Signed-off-by: cui fliter <imcusg@gmail.com>
p.stopHeartbeat = nil
p.Release()

for {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里有一个风险,如果某一个 worker 里的任务阻塞了,则这里就永远无法退出了。

Copy link
Owner

@panjf2000 panjf2000 Aug 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外,其实你这里的代码和 ReleaseTimeout(timeout) 基本是一样的,我更倾向于直接修改 ReleaseTimeout(timeout),当 timeout < 0 的时候,就一直等到所有 workers 退出才结束,这样也不用新加一个 API 了。

Copy link
Owner

@panjf2000 panjf2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL

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.

None yet

2 participants