Skip to content

Commit

Permalink
Increase removal timeout when uninstall (#4921)
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.
  • Loading branch information
rdner authored Jun 13, 2024
1 parent 6e55d65 commit 1f3ddcd
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 @@ -160,7 +160,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 1f3ddcd

Please sign in to comment.