Repository navigation
Commit cb9213a
fix(core): Write the live session even if the previous session move fails
Skipping the write only delayed the loss of the last run's session: a
rename that fails keeps failing, and the SessionStart path then writes
over the old file anyway. Write the live session and mark the move as
done once the write succeeds, so the init-time move cannot take it.
After a failed write, delete the truncated file only if the move worked.
If the move failed, the file can still be the last run's session, so it
stays for a later move to retry.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 33fc2b6 commit cb9213a
2 files changed
Lines changed: 37 additions & 14 deletions
File tree
- sentry/src
- main/java/io/sentry/cache
- test/java/io/sentry/cache
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | 405 | | |
413 | 406 | | |
414 | | - | |
415 | | - | |
416 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
417 | 414 | | |
418 | 415 | | |
419 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
868 | | - | |
| 868 | + | |
869 | 869 | | |
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
875 | 889 | | |
876 | | - | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
877 | 901 | | |
878 | | - | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
879 | 905 | | |
880 | 906 | | |
881 | 907 | | |
882 | 908 | | |
883 | 909 | | |
884 | | - | |
| 910 | + | |
885 | 911 | | |
886 | 912 | | |
887 | 913 | | |
| |||
0 commit comments