Skip to content

cmd/containerd: use golang.org/x/sys Service.SetRecoveryActions()#7512

Merged
estesp merged 1 commit intocontainerd:mainfrom
thaJeztah:use_SetRecoveryActions
Oct 12, 2022
Merged

cmd/containerd: use golang.org/x/sys Service.SetRecoveryActions()#7512
estesp merged 1 commit intocontainerd:mainfrom
thaJeztah:use_SetRecoveryActions

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

Looks like this is the equivalent of the local implementation.

@thaJeztah
Copy link
Copy Markdown
Member Author

@kevpar @jterry75 ptal 😄

serviceConfigFailureActions = 2
return s.SetRecoveryActions(
[]mgr.RecoveryAction{
{Type: mgr.ServiceRestart, Delay: 15 * time.Second / time.Millisecond},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Delay is a time.Duration, and gets converted to milliseconds by SetRecoveryActions, so we should just pass 15*time.Second here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ooof! Good catch 😬 🤦‍♂️ It crossed my mind, but then went off to check "Did we change this timeout? " (to go and find cee19d1).

Either way; fixed it, thanks!

This is the equivalent of the local implementation.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the use_SetRecoveryActions branch from 6430418 to 634bf0d Compare October 12, 2022 07:45
@thaJeztah thaJeztah requested a review from kevpar October 12, 2022 07:46
Copy link
Copy Markdown
Member

@kevpar kevpar left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 8b804c4 into containerd:main Oct 12, 2022
@jterry75
Copy link
Copy Markdown
Contributor

Late, but LGTM

@thaJeztah thaJeztah deleted the use_SetRecoveryActions branch October 12, 2022 17:31
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

Successfully merging this pull request may close these issues.

4 participants