Producer: ignore .okf-write-*.tmp orphans in RequireEmpty, pruning and the staging commit

Open
#219 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
62/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
data

Research direction

Start in producers/ at BundleWriter.cs: RequireEmpty near line 70, the empty-directory pruning around lines 896-904, and CommitStaging around line 1402, which enumerates staging files with EnumerateFiles(staging, "*"). Find where the .okf-write-*.tmp pattern is defined in FileSystemBundleProvider so the orphan check matches it. Done means all three sites ignore orphans without deleting them, with tests in OkfProducer.Tests run via dotnet test producers/OkfProducer.sln.

Written by the indexing model from the issue text.

Description

FileSystemBundleProvider can leave a .okf-write-<32hex>.tmp (crash, Windows ReplaceFile 1176/1177 under contention, BundleWriteOutcomeUnknownException). In producers/:

  • BundleWriter.cs:70 (RequireEmpty, EnumerateFileSystemEntries().Any()) refuses a directory holding only such orphans;
  • empty-directory pruning (~:896-904) keeps a directory that holds one;
  • CommitStaging (~:1402, EnumerateFiles(staging, "*")) would copy an orphan left in staging into the bundle.

Decide per site: ignore and report it (never delete: it may be the only copy of the new content, as the provider's docs say) and skip it in CommitStaging. Tests in OkfProducer.Tests; producers/ is outside CI, run dotnet test producers/OkfProducer.sln locally.

Follow-up of #157, found by the audit.

Dominant language
C#
Stars
4
Forks
1
Avg merge
1d 4h
Merged PRs (30d)
32

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jchable/okf4net

All issues in jchable/okf4net

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.