Repository navigation
Improve StorageService Resource Ownership and Document Shared Contracts - #244
Merged
Merged
Conversation
- Adopt DisposableOwnership for listener socket creation and ArticleIndex writer initialization - Dispose ArticleIndex databases when initialization fails before publication - Add regression tests for listener bind failures and index initialization failures - Clarify ApplicationLocalPath and StorageRelativePath contracts - Document proposed Common systemd host abstraction and outstanding lifecycle policy differences
- Use `using var` to guarantee database disposal on assertion failures - Preserve the explicit double-dispose check for idempotency - Ensure cleanup runs even if the explicit `Dispose()` throws
- Reduce CPU-sink benchmark batch from 384 to 64 articles - Use the default worker control interval instead of 1 ms polling - Preserve 1/2/4/8-worker throughput measurements - Avoid Linux CI timeouts without weakening hang detection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary
Improve resource ownership and failure-path cleanup in StorageService, clarify shared path-helper contracts, and document a proposed systemd host abstraction for future consideration.
Changes
DisposableOwnership<Socket>inStorageVatpListenerServiceto ensure sockets are disposed if binding or listening fails._writerfrom retaining a disposed connection after initialization failure.ArticleIndexDatabaseinstances when initialization fails.ApplicationLocalPathandStorageRelativePath, including lexical path containment and filesystem-related limitations.Validation
dotnet format VectorNNTPD.slnx --verify-no-changes: passed.Scope
This PR does not implement a shared systemd abstraction or change BackFiller lifecycle management. The systemd document is a design proposal only; consolidation remains dependent on agreement about readiness and failure-handling contracts.
Testing Notes
The regression tests cover listener bind failure and ArticleIndex initialization failure. They do not directly exercise socket disposal after bind failure or the specific
OpenReaders()failure that motivated the ownership-transfer ordering. These remain potential opportunities for stronger coverage.