mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3385] [CLOSED] [Engine] avoid hanging on PleReader initialization failures #4606
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4606
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3385
Author: @j-luwierski
Created: 10/20/2026
Status: ❌ Closed
Base:
main← Head:codex/ple-reader-init-beta📝 Commits (1)
9f4b65fngram: avoid draining nonexistent reads after initialization failures📊 Changes
3 files changed (+136 additions, -1 deletions)
View changed files
📝
CMakeLists.txt(+19 -0)📝
src/ngram/ple_reader.cpp(+3 -1)➕
tests/platform/ple_reader_lifecycle.cpp(+114 -0)📄 Description
Problem and result
On current upstream main,
PleReader::open()still hangs during cleanup if read-buffer allocation fails or if a reader is reopened with a table range beyond EOF. The failedopen()never returns its existing error. After this change, it closes cleanly and a later valid open/read succeeds.Related discussion
Retested the report in #3045, which was closed during the 0.2.0-beta tracker reset. The original PR #3046 was also closed in that reset.
Approach
Publish the in-flight slot count only after the buffers and free-slot list are ready, and reset the count when closing. Add Linux CPU-only lifecycle coverage for normal reads, failed reopen, and injected allocation failure in caller-thread and I/O-worker modes. The allocation failure uses link-time
posix_memalignwrapping and does not add production fault-injection behavior.Validation
Linux x86_64, GCC 14.2.0, CUDA 13.4.92, NVIDIA RTX 4070 Ti SUPER; base revision
e88ee39d1d6be6e3364183af3b39b62a7ed6f211, candidate revision9f4b65fc.Passed:
cmake -S . -B build/ple-reader-beta -DSTRATA_BUILD_TESTS=ON -DSTRATA_WERROR=ON;cmake --build build/ple-reader-beta --target ple_reader_lifecycle_test direct_file_async_test -j2; andctest --test-dir build/ple-reader-beta --output-on-failure -R '^(ple_reader_(reads|reopen|alloc)_(caller|threaded)|direct_file_async_test)$': targets built and all 7 tests passed.cmake -S . -B build/ple-reader-cuda -DSTRATA_BUILD_TESTS=ON -DSTRATA_WERROR=OFF -DSTRATA_ENABLE_CUDA=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda-13.4/bin/nvcc;cmake --build build/ple-reader-cuda --target strata ple_reader_lifecycle_test direct_file_async_test -j2: all targets built.ctest --test-dir build/ple-reader-cuda --output-on-failure -R '^(ple_reader_(reads|reopen|alloc)_(caller|threaded)|direct_file_async_test)$': all 7 tests passed.e88ee39d: both read controls passed;reopenand injectedalloccases timed out after 2 seconds in caller and threaded modes (4 hangs).git diff --check origin/main...HEAD: passed.Failed:
STRATA_WERROR=ON, the CUDA build commandcmake --build build/ple-reader-cuda --target strata ple_reader_lifecycle_test direct_file_async_test -j2stopped on-Werror=misleading-indentationin unchangedsrc/core/layer.cpp. The CUDA build passed with WERROR disabled; warnings are outside this change.Not run:
hipcc,dpcppandicpxare unavailable.Limits
The reproduction uses a synthetic file and real DirectFile I/O on Linux; it verifies initialization and recovery behavior, not a production memory-pressure incident or model inference.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.