Commit fddd4a6
gopls/filecache: prevent premature CAS file eviction
If the CAS file exists with the correct content when setting
a cache value, the timestamp on the CAS file was not being
updated. This causes the garbage collector to evict the CAS
file potentially long before the index file. This can result
in a large cache having many orphaned index files.
This change ensures that the CAS file timestamp is updated
even if it already exists during a Set call.
Change-Id: I1f16253d7a8a5d0f9d2b6d7e1e766f34c5661303
Reviewed-on: https://go-review.googlesource.com/c/tools/+/740900
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Madeline Kalil <mkalil@google.com>1 parent e3a69ff commit fddd4a6
1 file changed
+14
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 128 | + | |
137 | 129 | | |
138 | 130 | | |
139 | 131 | | |
| |||
198 | 190 | | |
199 | 191 | | |
200 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
201 | 196 | | |
202 | 197 | | |
203 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
204 | 209 | | |
205 | 210 | | |
206 | 211 | | |
| |||
0 commit comments