Skip to content

Call container.Terminate() on shutdown timeouts - #1488

Merged
Danny Canter (dcantah) merged 1 commit into
microsoft:mainfrom
dcantah:timeout-terminate
Aug 24, 2022
Merged

Call container.Terminate() on shutdown timeouts#1488
Danny Canter (dcantah) merged 1 commit into
microsoft:mainfrom
dcantah:timeout-terminate

Conversation

@dcantah

Copy link
Copy Markdown
Contributor

We were logging if HcsShutdownComputeSystem failed, but we weren't
trying to force kill the container via Terminate after if we timed
out waiting for it to complete. Shutdown is async and we wait for
a notification for success, so most of the time the call itself will
return nil, but it doesn't indicate indicate success until we can
see that the system exited. So now we will fallback to Terminate for:

  1. Shutdown returning an error that doesn't indicate the result is
    to be waited on.
  2. The async result of shutdown was non-nil
  3. Waiting for the result passed the timeout we set.

We were logging if HcsShutdownComputeSystem failed, but we weren't
trying to force kill the container via Terminate after if we timed
out waiting for it to complete. Shutdown is async and we wait for
a notification for success, so most of the time the call itself will
return nil, but it doesn't indicate indicate success until we can
see that the system exited. So now we will fallback to Terminate for:
1. Shutdown returning an error that doesn't indicate the result is
to be waited on.
2. The async result of shutdown was non-nil
3. Waiting for the result passed the timeout we set.
Signed-off-by: Daniel Canter <dcanter@microsoft.com>
@dcantah
Danny Canter (dcantah) requested a review from a team as a code ownerAugust 24, 2022 02:43
@dcantah
Danny Canter (dcantah) merged commit f12cf48 into microsoft:mainAug 24, 2022
Kirtana Ashok (kiashok) pushed a commit to kiashok/hcsshim that referenced this pull request Oct 29, 2022
Call container.Terminate() on shutdown timeouts
(cherry picked from commit f12cf48)
Signed-off-by: Kirtana Ashok <Kirtana.Ashok@microsoft.com>
Kirtana Ashok (kiashok) pushed a commit to kiashok/hcsshim that referenced this pull request Oct 29, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@dcantah@anmaxvl@helsaawy