Repository navigation
Commit 1fb3404
committed
fs: bound the mkdir recursive ENOENT retry loop
mkdir(path, { recursive: true }) creates missing parent directories by
retrying whenever mkdir() fails with ENOENT, but nothing tracks
whether a retry actually made progress. If the same path keeps
failing with ENOENT even after its parent exists (e.g. under procfs,
or during a racing directory removal), the retry loops forever at
100% CPU with no way to interrupt a sync call.
Track the path last requeued after ENOENT in FSContinuationData and
clear it on a successful mkdir(). If the same path is retried again
with no progress since, fail with the original error instead of
looping. Applies to both MKDirpSync and MKDirpAsync.
Fixes: #66268
Signed-off-by: agape1225 <49804691+agape1225@users.noreply.github.com>1 parent 2b3e3db commit 1fb3404
4 files changed
Lines changed: 86 additions & 0 deletions
File tree
- src
- test/parallel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
30 | 43 | | |
31 | 44 | | |
32 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1951 | 1951 | | |
1952 | 1952 | | |
1953 | 1953 | | |
| 1954 | + | |
1954 | 1955 | | |
1955 | 1956 | | |
1956 | 1957 | | |
| |||
1966 | 1967 | | |
1967 | 1968 | | |
1968 | 1969 | | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
1969 | 1979 | | |
1970 | 1980 | | |
1971 | 1981 | | |
| |||
2022 | 2032 | | |
2023 | 2033 | | |
2024 | 2034 | | |
| 2035 | + | |
2025 | 2036 | | |
2026 | 2037 | | |
2027 | 2038 | | |
| |||
2047 | 2058 | | |
2048 | 2059 | | |
2049 | 2060 | | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
2050 | 2068 | | |
2051 | 2069 | | |
2052 | 2070 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
117 | 125 | | |
118 | 126 | | |
119 | 127 | | |
| |||
130 | 138 | | |
131 | 139 | | |
132 | 140 | | |
| 141 | + | |
| 142 | + | |
133 | 143 | | |
134 | 144 | | |
135 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments