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

syscallWatcher should support early cancellation #395

Closed
jterry75 opened this issue Nov 29, 2018 · 1 comment
Closed

syscallWatcher should support early cancellation #395

jterry75 opened this issue Nov 29, 2018 · 1 comment

Comments

@jterry75
Copy link
Contributor

The syscallWatcher today will effectively stack goroutines overtime. At the time of this post the defaultTimeout is 4 minutes which means that all syscalls (even completed ones) will have an open goroutine (although sleeping) for 4 minutes. This pattern should support a context.Context cancellation after a return from a syscall as we no longer need to monitor for a hung state.

It would likely look something like:

ctx, cancel := context.WithTimeout(context.Background(), defautTimeout)
defer cancel()
go syscallWatcher(ctx, ...)
// make syscall
return result

So if the syscall returns we cancel the syscallWatcher and if it times out before returning we get the appropriate syscall hung state as expected.

@jterry75
Copy link
Contributor Author

jterry75 commented Jan 3, 2019

This was fixed.

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

1 participant