From 910d17b42be5a7e04688573c5cfd2d7cbe9e00fa Mon Sep 17 00:00:00 2001 From: Craig MacKenzie Date: Thu, 26 Oct 2023 16:42:33 -0400 Subject: [PATCH] Increase the Windows OnFailureDelayDuration delay to 15s (#3657) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update Windows OnFailureDelayDuration to 15s. This matches the value that endpoint uses and helps mitigate bugs where agent unexpectedly restarts during a system shutdown. * Add changelog. * Update changelog/fragments/1698259940-Increase-wait-period-between-service-restarts-on-failure-to-15s-on-Windows.yaml Co-authored-by: Paolo Chilà --------- Co-authored-by: Paolo Chilà --- ...restarts-on-failure-to-15s-on-Windows.yaml | 32 +++++++++++++++++++ internal/pkg/agent/install/svc.go | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 changelog/fragments/1698259940-Increase-wait-period-between-service-restarts-on-failure-to-15s-on-Windows.yaml diff --git a/changelog/fragments/1698259940-Increase-wait-period-between-service-restarts-on-failure-to-15s-on-Windows.yaml b/changelog/fragments/1698259940-Increase-wait-period-between-service-restarts-on-failure-to-15s-on-Windows.yaml new file mode 100644 index 00000000000..d8c46d8e4dc --- /dev/null +++ b/changelog/fragments/1698259940-Increase-wait-period-between-service-restarts-on-failure-to-15s-on-Windows.yaml @@ -0,0 +1,32 @@ +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: bug-fix + +# Change summary; a 80ish characters long description of the change. +summary: Increase wait period between service restarts on failure to 15s on Windows. + +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. +description: This is the same value used by other Elastic windows services like endpoint-security. + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: "elastic-agent" + +# PR URL; optional; the PR number that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +#pr: https://github.com/owner/repo/1234 + +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +#issue: https://github.com/owner/repo/1234 diff --git a/internal/pkg/agent/install/svc.go b/internal/pkg/agent/install/svc.go index 12b389de05f..2fbc0c61803 100644 --- a/internal/pkg/agent/install/svc.go +++ b/internal/pkg/agent/install/svc.go @@ -49,7 +49,7 @@ func newService(topPath string) (service.Service, error) { // Windows setup restart on failure "OnFailure": "restart", - "OnFailureDelayDuration": "1s", + "OnFailureDelayDuration": "15s", // Matches the value used by endpoint-security. "OnFailureResetPeriod": 10, }, }