Skip to content

fix race condition with cache file writing#833

Merged
jdx merged 1 commit intomainfrom
race
Aug 22, 2023
Merged

fix race condition with cache file writing#833
jdx merged 1 commit intomainfrom
race

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Aug 22, 2023

No description provided.

@jdx
Copy link
Copy Markdown
Owner Author

jdx commented Aug 22, 2023

multiple processes were writing to the .part file which could only be moved by the first process. This makes each filename unique.

@jdx jdx enabled auto-merge (squash) August 22, 2023 23:18
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 22, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (11240d0) 87.59% compared to head (d79f4d0) 87.59%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #833   +/-   ##
=======================================
  Coverage   87.59%   87.59%           
=======================================
  Files         131      132    +1     
  Lines       11499    11508    +9     
=======================================
+ Hits        10072    10081    +9     
  Misses       1427     1427           
Files Changed Coverage Δ
src/main.rs 91.30% <ø> (ø)
src/cache.rs 92.92% <100.00%> (+0.14%) ⬆️
src/rand.rs 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jdx jdx merged commit c2728af into main Aug 22, 2023
@jdx jdx deleted the race branch August 22, 2023 23:37
Comment on lines +92 to +94
let partial_path = self
.cache_file_path
.with_extension(format!("part-{}", random_string(8)));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming whatever happened at this location before was overwriting previous work. If so, that means there was sort of some control over the total disk space that it would use. This is a recipe for many files (so might use up disk space or inodes depending on what goes here)

jdx pushed a commit that referenced this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rtx::cache: failed to parse cache file when starting multiple shells in Zellij

2 participants