Recipe atomic writes share one temp file per key
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
The race is in the atomic-write block of each language writer: recipes/csharp/Program.cs:211, recipes/elixir/xenv.exs:219, recipes/go/xenv/xenv.go:286, recipes/java/Xenv.java:237, recipes/node/xenv.js:166, recipes/pythong/xenv.py:178, recipes/ruby/xenv.rb:161 and recipes/rust/src/lib.rs:391. Start with bin/xenv's .tmp.$$ approach as the reference, then decide with maintainers whether to fix all eight writers or wait for #16 to delete them. Done means unique O_EXCL temp names in each writer and no shared <key>.value.enc.tmp path left.
Written by the indexing model from the issue text.
Description
Files: recipes/csharp/Program.cs:211; recipes/elixir/xenv.exs:219; recipes/go/xenv/xenv.go:286; recipes/java/Xenv.java:237; recipes/node/xenv.js:166; recipes/pythong/xenv.py:178; recipes/ruby/xenv.rb:161; recipes/rust/src/lib.rs:391
Repro: Two processes call set on the same key. Both truncate .value.enc.tmp. One rename leaves a torn or swapped envelope. If that path is a symlink, Go and Node write the target.
Fix: Use a unique temp name and O_EXCL, as bin/xenv does with .tmp.$$. #16 deletes these writers. Until then the race is live.
Found at 6e8d2b4 by three runs of a whole-repo review team (deploystrata/offload), then hand-checked against the code by Grok. Lines marked Reproduced were also run by Claude.
- Dominant language
- Shell
- Stars
- 8
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ahoward/xenv
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
lobaro/restic-backup-docker#114 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
community-scripts/ProxmoxVE#18529 · 2 comments ·
Maintainers usually reply within 1 day