Commit 7368028
authored
Add support to
* Add support to write_to_textfile for custom tmpdir
While the try/except block does prevent most of the temp files from
persisting, if there is a non catchable exception, those temp files
continue to pollute the directory. Optionally set the temp
directory would let us write to something like /tmp, so the target
directory isn't polluted
Signed-off-by: Aaditya Dhruv <[email protected]>
* Modify write_to_textfile to ensure tmpdir is on same filesystem
The tmpdir must be on the same filesystem to ensure an atomic operation
takes place. If this is not enforced, there could be partial writes
which can lead to partial/incorrect metrics being exported
Signed-off-by: Aaditya Dhruv <[email protected]>
---------
Signed-off-by: Aaditya Dhruv <[email protected]>write_to_textfile for custom tmpdir (#1115)1 parent 26da805 commit 7368028
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
| 449 | + | |
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | | - | |
454 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
455 | 464 | | |
456 | 465 | | |
457 | 466 | | |
| |||
0 commit comments