Commit ac9e5a9
committed
Don't delete the instance database file on reset
Deleting the file is unsafe as it could be being written to in a
different process and cause the write to end up in an unlinked file. For
example: `cvd reset` could be called concurrently with a `cvd create`
invocation. If the reset command deletes the database file while
`create` is writing to it, the writes will be lost, but `create` will
not find out and continue to start the device, leaving untracked running
devices behind.
`cvd reset` clears the database which effectively truncates the file to
zero size, so it has almost the same effect as deleting it.1 parent 2907b20 commit ac9e5a9
File tree
1 file changed
+0
-10
lines changed- base/cvd/cuttlefish/host/commands/cvd/instances
1 file changed
+0
-10
lines changedLines changed: 0 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | 299 | | |
305 | 300 | | |
306 | 301 | | |
307 | 302 | | |
308 | 303 | | |
309 | 304 | | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | 305 | | |
316 | 306 | | |
317 | 307 | | |
| |||
0 commit comments