Skip to content

Comments

Fix CapioFile unlink bug and improve logging#207

Merged
GlassOfWhiskey merged 4 commits intomasterfrom
capio-file-bugfix
Feb 19, 2026
Merged

Fix CapioFile unlink bug and improve logging#207
GlassOfWhiskey merged 4 commits intomasterfrom
capio-file-bugfix

Conversation

@marcoSanti
Copy link
Member

@marcoSanti marcoSanti commented Feb 17, 2026

This pull request fixes a bug in the CapioFile class that prevented a file from being correctly removed after an unlink operation.

On the POSIX side, when a clone() was issued, the CapioFile::clone() method was invoked for each CapioFile instance registered to the calling thread (tid).

The issue was that CapioFile::clone() always incremented _n_opens. As a result, even after all threads invoked close() on the corresponding CapioFile, the internal open counter never reached zero, preventing the file from being deleted.

CapioFile::clone() no longer increments _n_opens automatically when a clone occurs. This ensures that the open counter accurately reflects the real number of active opens, allowing files to be properly removed after unlink once all handles are closed.

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.14%. Comparing base (4ab957c) to head (ed58273).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
+ Coverage   56.13%   56.14%   +0.01%     
==========================================
  Files          71       71              
  Lines        3481     3482       +1     
  Branches     2164     2165       +1     
==========================================
+ Hits         1954     1955       +1     
  Misses        589      589              
  Partials      938      938              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marcoSanti marcoSanti force-pushed the capio-file-bugfix branch 2 times, most recently from 5e86fdd to a367b43 Compare February 18, 2026 14:34
Add TODO for supporting CLONE_FILES flag in _addNewFdToStorage
Fix typo in TODO comment regarding CLONE_FILES flag.
@GlassOfWhiskey GlassOfWhiskey merged commit 79e5b06 into master Feb 19, 2026
30 checks passed
@GlassOfWhiskey GlassOfWhiskey deleted the capio-file-bugfix branch February 19, 2026 10:38
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.

2 participants