Migrate indexing::LFS to task system, rather than ringbuffer#7955
Open
eddyashton wants to merge 3 commits into
Open
Migrate indexing::LFS to task system, rather than ringbuffer#7955eddyashton wants to merge 3 commits into
eddyashton wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the indexing LFS (large-file cache) path away from ringbuffer-based host messaging and onto the task system, so LFS store/fetch operations are scheduled as ordered tasks rather than sent to a host-side handler.
Changes:
- Replace ringbuffer messaging for LFS with an
OrderedTasksqueue backed by aJobBoard, and perform disk I/O fromEnclaveLFSAccess. - Update indexing tests to drive LFS I/O by draining a
JobBoard(synchronously inlfs.cpp, via a flusher thread inindexing.cpp). - Remove the obsolete ringbuffer message types and host-side
LFSFileHandlerplumbing.
Custom instructions used:
.github/copilot-instructions.md.github/instructions/reviewing.instructions.md
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/indexing/test/lfs.cpp | Switches LFS test plumbing from ringbuffers to draining a JobBoard. |
| src/indexing/test/indexing.cpp | Replaces ringbuffer flushing thread with a JobBoard task-draining thread for LFS. |
| src/indexing/lfs_ringbuffer_types.h | Removes LFS ringbuffer message definitions (no longer used). |
| src/indexing/enclave_lfs_access.h | Implements LFS store/fetch via ordered tasks and direct file I/O under .index. |
| src/host/run.cpp | Removes registration of the host-side LFS ringbuffer message handler. |
| src/host/lfs_file_handler.h | Removes the host-side LFS file handler implementation. |
| src/enclave/enclave.h | Instantiates EnclaveLFSAccess on the main job board and removes ringbuffer handler registration. |
Comment on lines
+155
to
+165
| asynchost::TimeBoundLogger log_if_slow( | ||
| fmt::format("Reading LFS file - ifstream({})", target_path.string())); | ||
| std::ifstream f(target_path, std::ios::binary); | ||
| f.seekg(0, std::ios::end); | ||
| const auto file_size = f.tellg(); | ||
| f.seekg(0, std::ios::beg); | ||
| LFSEncryptedContents blob(static_cast<size_t>(file_size)); | ||
| f.read( | ||
| reinterpret_cast<char*>(blob.data()), | ||
| static_cast<std::streamsize>(blob.size())); | ||
| return blob; |
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.
I could have sworn I opened this yesterday? But apparently not.