Skip to content

Commit f712b69

Browse files
authored
Merge pull request #788 from heynemax/main
agent: retry mount on ENOMEM
2 parents 9bad4be + 99b03b3 commit f712b69

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

agent/error.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818
)
1919

2020
// isRetryableMountError will check to see if the error passed in is an
21-
// syscall.EINVAL
21+
// syscall.EINVAL or syscall.ENOMEM
2222
func isRetryableMountError(err error) bool {
2323
errno, ok := err.(syscall.Errno)
24-
return ok && errno == syscall.EINVAL
24+
return ok && (errno == syscall.EINVAL || errno == syscall.ENOMEM)
2525
}

agent/error_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ func TestIsRetryableMountError(t *testing.T) {
3737
Error: syscall.EINVAL,
3838
Expected: true,
3939
},
40+
{
41+
Name: "syscall.Errno ENOMEM case",
42+
Error: syscall.ENOMEM,
43+
Expected: true,
44+
},
4045
{
4146
Name: "syscall.Errno ENOENT case",
4247
Error: syscall.ENOENT,

0 commit comments

Comments
 (0)