Repository navigation
fix(config): reject processes values below 1 - #1192
Open
rootsiemen wants to merge 1 commit into
Open
rootsiemen wants to merge 1 commit into
rootsiemen wants to merge 1 commit into
Conversation
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.
Closes #1182
What changed
servers.*.processesnow has->min(1)inConfigurationTreeBuilder(keepsdefaultNull):0and negative values are rejected at config validation with a clearInvalidConfigurationExceptioninstead of passing through.processes: 0andprocesses: -1, accept the boundary1and thenulldefault (one field perprocess()call, per FAQ-035).[Unreleased]->Fixed.Why
ServerWorkerpasses the value straight toWorker::$count, and Workerman silently clamps it to one worker — so a typo likeprocesses: 0produced a running server with no visible error. Failing fast at config load surfaces the mistake immediately.SupervisorWorker's<= 0filter was left untouched: it guards a different path (the#[AsProcess]attributeprocesses, not theservers.*.processesconfig node), so it stays as defense-in-depth for programmatic config.Tests
ConfigurationTreeBuilderTest(new tests first failed pre-fix, proving the bug: 0/-1 passed validation; after the fix all pass): 3/3 new tests green.composer install:ConfigurationTreeBuilderTest+SupervisorWorkerTest69/69 green;ServerWorkerTest44/46 — the 2 failures (testUnreadableCertThrowsException,testUnreadableKeyThrowsException) also fail on pristine master: the suite runs as root, so chmod-000 cert/key files stay readable (pre-existing, unrelated).composer lint: php-cs-fixer, PHPStan level 8, Rector, kb-lint, check-changelog, exception-usage and upgrade-exceptions all OK. Two pre-existing failures unrelated to this diff: shellcheck SC2015 (info) in the sharedbin/worktree-done.sh(byte-identical script, must not be edited) andhadolintnot installed in this environment.