Skip to content

Possible blocking on waitCh #1021

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

Closed
ghost opened this issue Aug 23, 2022 · 1 comment
Closed

Possible blocking on waitCh #1021

ghost opened this issue Aug 23, 2022 · 1 comment
Milestone

Comments

@ghost
Copy link

ghost commented Aug 23, 2022

func onError() {
    ...
    e.waitCh <- &drivers.ExitResult
}

waitCh is defined as

func newDtleTaskHandle() {
		waitCh:      make(chan *drivers.ExitResult, 1),
}

and read only once

func handleWait() {
	case result := <-handle.waitCh:
}

A concurrent call to onError might block on waitCh forever.

@ghost
Copy link
Author

ghost commented Aug 26, 2022

StopTask() vs DestroyTask()

  • 主动nomad job stop时,先调用StopTask再调用DestroyTask
  • 任务报错退出时,只调用DestroyTask

目前两者都调用了handle.Destroy(), 待review。

ghost pushed a commit that referenced this issue Aug 29, 2022
@ghost ghost added this to the 4.22.08.0 milestone Aug 29, 2022
@ghost ghost closed this as completed Sep 7, 2022
This issue was closed.
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

No branches or pull requests

0 participants