Commit 48d5816
Roy Lin
fix(box): make CRI ReopenContainerLog synchronous (wait for supervisor reopen)
ReopenContainerLog fired a fire-and-forget Notify and returned immediately,
while the exit supervisor reopened the log writer asynchronously — so output
written after the RPC returned could still land in the old (rotated) file,
making the "reopening container log" conformance spec flaky.
The per-container reopen handle now carries a `done` Notify alongside the
`request`: the RPC signals the request and waits (bounded 5s) for the
supervisor to ack once `CriLogWriter::reopen` has completed, so the new file
is guaranteed in place before the RPC returns. This is the correct CRI
semantic (the call is synchronous).
This substantially reduces the flake but does not fully eliminate it: a
residual race remains in the supervisor's `select!` ordering (pending pipe
output read after the reopen can land in the new file). Tracked as a
follow-up; needs the supervisor to drain buffered output to the old writer
before reopening.
Verified: build + clippy clean, cri tests pass (reopen unit test updated for
the new handle), reopen-log critest now passes ~2/3 (was ~1/2).1 parent a343143 commit 48d5816
3 files changed
Lines changed: 70 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
75 | 84 | | |
76 | 85 | | |
77 | 86 | | |
| |||
1059 | 1068 | | |
1060 | 1069 | | |
1061 | 1070 | | |
| 1071 | + | |
1062 | 1072 | | |
1063 | 1073 | | |
1064 | 1074 | | |
| |||
1074 | 1084 | | |
1075 | 1085 | | |
1076 | 1086 | | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1081 | 1094 | | |
1082 | 1095 | | |
1083 | 1096 | | |
| |||
1101 | 1114 | | |
1102 | 1115 | | |
1103 | 1116 | | |
| 1117 | + | |
1104 | 1118 | | |
1105 | 1119 | | |
1106 | 1120 | | |
| |||
2254 | 2268 | | |
2255 | 2269 | | |
2256 | 2270 | | |
2257 | | - | |
2258 | | - | |
2259 | | - | |
2260 | | - | |
2261 | | - | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
2262 | 2299 | | |
2263 | 2300 | | |
2264 | 2301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3191 | 3191 | | |
3192 | 3192 | | |
3193 | 3193 | | |
3194 | | - | |
| 3194 | + | |
3195 | 3195 | | |
3196 | | - | |
3197 | | - | |
3198 | | - | |
3199 | | - | |
3200 | | - | |
3201 | | - | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
3202 | 3209 | | |
3203 | 3210 | | |
3204 | 3211 | | |
3205 | 3212 | | |
3206 | 3213 | | |
3207 | 3214 | | |
3208 | 3215 | | |
3209 | | - | |
3210 | | - | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
3211 | 3219 | | |
3212 | | - | |
| 3220 | + | |
3213 | 3221 | | |
3214 | 3222 | | |
3215 | 3223 | | |
| |||
0 commit comments