-
Notifications
You must be signed in to change notification settings - Fork 276
Closed
Description
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 resultSo if the syscall returns we cancel the syscallWatcher and if it times out before returning we get the appropriate syscall hung state as expected.
Metadata
Metadata
Assignees
Labels
No labels