Commit 35b05c6
committed
tail: fix TOCTOU race in follow retry logic
* Replace exists() check followed by metadata().unwrap() with a single if-let on metadata().
The file could be removed between the two calls, causing a panic
with "No such file or directory" (seen intermittently in test_retry9).1 parent ffada0f commit 35b05c6
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
510 | 512 | | |
511 | | - | |
512 | 513 | | |
513 | 514 | | |
514 | 515 | | |
| |||
0 commit comments