JFJochXFELReader: the positional-read handles are held for the most recent files only
The direct chunk read opened one HDF5ImageSource::RawFile per file and never released it, so the MAX_OPEN_FILES bound on the HDF5 handles did not hold for that path: a dataset stored one frame per file would keep a descriptor per file open. They now follow the same least-recently-used bound; a reading thread still holding a released handle keeps it through its shared_ptr. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu
This commit is contained in:
1 parent
2bd3616388
commit
3d8728e3a1
2 files changed
+10
-1
No files matched your search
@@ -84,6 +84,7 @@ std::shared_ptr<const HDF5ImageSource::RawFile> JFJochXFELReader::RawFileAt(size
|
||||
if (raw_files_.size() != files_.size()) {
|
||||
raw_files_.assign(files_.size(), nullptr);
|
||||
user_block_.assign(files_.size(), 0);
|
||||
raw_order_.clear();
|
||||
}
|
||||
if (!raw_files_[file]) {
|
||||
const hid_t fcpl = H5Fget_create_plist(FileAt(file).GetID());
|
||||
@@ -97,6 +98,11 @@ std::shared_ptr<const HDF5ImageSource::RawFile> JFJochXFELReader::RawFileAt(size
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Cannot open " + files_[file]);
|
||||
raw_files_[file] = raw;
|
||||
user_block_[file] = user_block;
|
||||
raw_order_.push_back(file);
|
||||
if (raw_order_.size() > MAX_OPEN_FILES) {
|
||||
raw_files_[raw_order_.front()].reset();
|
||||
raw_order_.erase(raw_order_.begin());
|
||||
}
|
||||
}
|
||||
return raw_files_[file];
|
||||
}
|
||||
@@ -718,6 +724,7 @@ void JFJochXFELReader::Close() {
|
||||
open_files_.clear();
|
||||
raw_files_.clear();
|
||||
user_block_.clear();
|
||||
raw_order_.clear();
|
||||
files_.clear();
|
||||
frames_.clear();
|
||||
dataset_.reset();
|
||||
|
||||
Reference in new issue
Block a user