Replace shell-based process runner with open3_safe#9
Open
vandric wants to merge 1 commit into
Open
Conversation
c7e7eac to
0a81aca
Compare
e5b63ee to
59c73e6
Compare
Replaces the bash pipe + system timeout binary approach in ExternalProcess#run with Open3Safe.capture3_safe, which provides proper stdout/stderr capture, timeout handling, and RSS-based memory limiting without spawning a shell. - Add open3_safe gem dependency - Propagate max_rss: keyword arg through public API and all extractors - Convert env strings to Hashes for Open3 compatibility - Remove 2>&1 redirects (stderr now captured separately) - Duplicate/blank-line filtering preserved in the new implementation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
59c73e6 to
7878767
Compare
|
Is the "Test plan" in the desc for me to test or it's more for AI? |
Author
From AI for AI, we will test it in Silverfin. |
|
PR is Approved. (didn't see anything on the UI for approval) |
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.
Summary
ExternalProcess#run's bash-pipe + systemtimeout/gtimeoutbinary approach withOpen3Safe.capture3_safe, which handles stdout/stderr capture, timeout, and RSS-based memory limiting without spawning an intermediate shellmax_rss:keyword argument throughout the public API (extract_text_with_timeouts,extract_images_with_timeouts) and propagates it down throughTextExtractor,ImageExtractor, and into eachruncall"MAGICK_TMPDIR=... OMP_NUM_THREADS=2") to a proper Hash as required by Open32>&1redirects from all command strings — stderr is now captured separately and merged with stdout after the fact, with the same blank-line and consecutive-duplicate filtering as before (guards against memory bloat from corrupt PDF warning floods — see silverfin/issues/1998)open3_safegem dependency (Gemfile,Gemfile.lock,docsplit.gemspec)Test plan
TimeoutErroris raisedmax_rss:value) and confirmTimeoutErroris raisedpdffontspath incontains_text?works correctly end-to-end🤖 Generated with Claude Code