Skip to content

Commit

Permalink
Merge pull request #788 from heynemax/main
Browse files Browse the repository at this point in the history
agent: retry mount on ENOMEM
  • Loading branch information
henry118 authored May 23, 2024
2 parents 9bad4be + 99b03b3 commit f712b69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions agent/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
)

// isRetryableMountError will check to see if the error passed in is an
// syscall.EINVAL
// syscall.EINVAL or syscall.ENOMEM
func isRetryableMountError(err error) bool {
errno, ok := err.(syscall.Errno)
return ok && errno == syscall.EINVAL
return ok && (errno == syscall.EINVAL || errno == syscall.ENOMEM)
}
5 changes: 5 additions & 0 deletions agent/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func TestIsRetryableMountError(t *testing.T) {
Error: syscall.EINVAL,
Expected: true,
},
{
Name: "syscall.Errno ENOMEM case",
Error: syscall.ENOMEM,
Expected: true,
},
{
Name: "syscall.Errno ENOENT case",
Error: syscall.ENOENT,
Expand Down

0 comments on commit f712b69

Please sign in to comment.