Skip to content

Commit

Permalink
Increase removal timeout when uninstall (#4921) (#4927)
Browse files Browse the repository at this point in the history
On particularly slow machines 30 seconds might be still not enough to
release the agent binary, so we're able to remove it on
uninstall. This change doubles the timeout to 60 seconds.

(cherry picked from commit 1f3ddcd)

Co-authored-by: Denis <[email protected]>
  • Loading branch information
mergify[bot] and rdner authored Jun 14, 2024
1 parent fdc46f3 commit 9f6413a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog/fragments/1718268915-increase-remove-timeout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: bug-fix
summary: Increase removal timeout when uninstall
component: "elastic-agent"
2 changes: 1 addition & 1 deletion internal/pkg/agent/install/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func checkForUnprivilegedVault(ctx context.Context, opts ...vault.OptionFunc) (b
// to an ERROR_SHARING_VIOLATION. RemovePath will retry up to 2
// seconds if it keeps getting that error.
func RemovePath(path string) error {
const arbitraryTimeout = 30 * time.Second
const arbitraryTimeout = 60 * time.Second
start := time.Now()
var lastErr error
for time.Since(start) <= arbitraryTimeout {
Expand Down

0 comments on commit 9f6413a

Please sign in to comment.