Skip to content

syscallWatcher should support early cancellation #395

@jterry75

Description

@jterry75

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions