Skip to content

Conversation

simongdavies
Copy link
Contributor

Fixes a race condition where a sandbox kill arrives after a sandbox has successfully exited causing the subsequent run to fail

…as successfully exited causing the subsequent run to fail

Signed-off-by: Simon Davies <[email protected]>
Copy link
Contributor

@jsturtevant jsturtevant left a comment

Choose a reason for hiding this comment

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

LGTM

// So we check to see if we really cancelled the vCPU or if it was just a normal exit and set the `cancelled` flag accordingly
// The order of setting the flags is important here, we need to set `cancelled` before clearing `running` as the `InterruptHandle::send_signal()` checks `running` to know when to stop sending signals
// and then checks to see if the vCPU was cancelled or not and clears the `cancel_requested` flag if it was.
// This prevents the case where we receive a cancel request after the vCPU has as below we only return cancelled if the vCPU was actually cancelled
Copy link
Contributor

Choose a reason for hiding this comment

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

This sentence is a bit awkward

@simongdavies
Copy link
Contributor Author

Closed in favour of #959

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bugfix For PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants