Repository navigation
Conversation
Member
|
This seems to introduce some cross-platform uncertainty to address a very specific edge case. The original issue only occurs when passing an unusually large number of paths as command-line arguments, and batching is already a documented workaround. Given the additional complexity, I don't think this change is worth introducing at this point. |
Member
|
closing as answered above :) |
intakt-runner Bot
pushed a commit
to shinyredapples/intakt
that referenced
this pull request
Nov 22, 2026
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.
Fixes the error from rectorphp/rector#9591 (closed as an OS limit, workaround: batching).
With parallel processing,
WorkerCommandLineFactoryputs every path given on the command line into each worker's command, a single string run through/bin/sh -c. Linux limits one argument string to 128 KiB, so once the paths pass that size no worker starts:The main process accepts the same paths, as each of its arguments is a separate string.
Measured on Linux 7.0, PHP 8.5.12,
rector/rector2.8.5 and rector-srcmain(e9fc2fd), withwithParallel()and empty classes under a long folder:Change: when paths are given, the main process writes them to a JSON temp file (
WorkerPathsFile) and passes it to the workers as--paths-file;WorkerCommandreads it into thesourceargument before building its configuration, so the workers see the same paths as before. With no command-line paths nothing changes.The file is removed when the run ends, on shutdown, and, when ext-pcntl is loaded, on SIGINT/SIGTERM: the handlers remove it and exit with 130/143. They are installed only for the parallel run and the previous handlers are restored afterwards; ext-pcntl stays optional.
Interrupting a 1,000-path run 1 s after start (
kill -INT/kill -TERMto the main process):Checked:
WorkerCommandLineFactoryTest::testPathsGoInPathsFile(1,000 paths, ~260 KiB): fails without the change, passes with it. The existing cases now expect no'src'on the worker line.WorkerPathsFileTest: the file holds the paths,remove()deletes it and can run twice, and the previous SIGINT/SIGTERM handlers and async-signal setting come back afterremove().fastunit tests rules-tests utils/phpstan/testson PHP 8.4 and 8.5, ECS, PHPStan,bin/rector process,swiss-knifefinalize/commented-code, and the 14 e2e directories frome2e.yaml: all pass.Open points:
ps.