Repository navigation
Commit 712fb79
committed
Read the current second for stat signatures off the filesystem clock
The kernel stamps files with a clock that advances only on a timer tick,
so for a few milliseconds after time() moves to the next second, a file
or directory written still gets the previous second. FileStatSignatures
compared timestamps to time(), so it vouched for such a change and a
DirectoryWalker listing or a result cache file hash could be reused over
different contents. This made DirectoryWalkerTest fail now and then when
the whole test suite was run.
The current second is now read off the mtime of a temporary file created
in begin(), the way git compares to the mtime of its index.
Amp-Thread-ID: https://ampcode.com/threads/T-01a21723-3824-7286-98c0-56d7b4e30d961 parent 4df5bec commit 712fb79
1 file changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
31 | 60 | | |
32 | 61 | | |
33 | 62 | | |
0 commit comments