Skip to content

oops, unknown child (13560) exited with code 0. Please open a bug report #9513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bytes-commerce opened this issue Sep 8, 2022 · 5 comments

Comments

@bytes-commerce
Copy link

Description

We upgraded from ECS ^8.3 to ^10.2 and updated the dependencies just as well (CS Fixer and Slavomat Fixers). Now, if we want to run ECS with our fixers on our grown codebase, we see this in our local env:

php-1             | [08-Sep-2022 15:51:10] ALERT: oops, unknown child (13559) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:11] ALERT: oops, unknown child (15507) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:12] ALERT: oops, unknown child (15525) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:13] ALERT: oops, unknown child (15538) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:13] ALERT: oops, unknown child (13560) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:14] ALERT: oops, unknown child (15543) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:14] ALERT: oops, unknown child (15544) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:15] ALERT: oops, unknown child (15545) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:15] ALERT: oops, unknown child (15546) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
localstack-1      | 2022-09-08T15:51:16.210 DEBUG --- [   asgi_gw_0] l.aws.serving.wsgi         : GET localhost:4566/health
php-1             | [08-Sep-2022 15:51:16] ALERT: oops, unknown child (15547) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:16] ALERT: oops, unknown child (15548) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:17] ALERT: oops, unknown child (15549) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).

We have a grown ECS file with 312 lines, so I'd rather not share it here. Instead, here are the Fixers we use:

use PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer;
use PhpCsFixer\Fixer\Operator\IncrementStyleFixer;
use PhpCsFixer\Fixer\Alias\EregToPregFixer;
use PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer;
use PhpCsFixer\Fixer\Alias\NoMixedEchoPrintFixer;
use PhpCsFixer\Fixer\Alias\PowToExponentiationFixer;
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer;
use PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer;
use PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer;
use PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer;
use PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer;
use PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer;
use PhpCsFixer\Fixer\Basic\BracesFixer;
use PhpCsFixer\Fixer\Basic\EncodingFixer;
use PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer;
use PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer;
use PhpCsFixer\Fixer\Casing\LowercaseStaticReferenceFixer;
use PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer;
use PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer;
use PhpCsFixer\Fixer\CastNotation\CastSpacesFixer;
use PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer;
use PhpCsFixer\Fixer\CastNotation\ModernizeTypesCastingFixer;
use PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer;
use PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer;
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer;
use PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer;
use PhpCsFixer\Fixer\ClassNotation\NoNullPropertyInitializationFixer;
use PhpCsFixer\Fixer\ClassNotation\NoPhp4ConstructorFixer;
use PhpCsFixer\Fixer\ClassNotation\NoUnneededFinalMethodFixer;
use PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer;
use PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer;
use PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer;
use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
use PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer;
use PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer;
use PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer;
use PhpCsFixer\Fixer\ConstantNotation\NativeConstantInvocationFixer;
use PhpCsFixer\Fixer\ControlStructure\ElseifFixer;
use PhpCsFixer\Fixer\ControlStructure\IncludeFixer;
use PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer;
use PhpCsFixer\Fixer\ControlStructure\NoSuperfluousElseifFixer;
use PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer;
use PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer;
use PhpCsFixer\Fixer\ControlStructure\NoUnneededCurlyBracesFixer;
use PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer;
use PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer;
use PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer;
use PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer;
use PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer;
use PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer;
use PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer;
use PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer;
use PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
use PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer;
use PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer;
use PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveIssetsFixer;
use PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveUnsetsFixer;
use PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer;
use PhpCsFixer\Fixer\LanguageConstruct\DirConstantFixer;
use PhpCsFixer\Fixer\LanguageConstruct\FunctionToConstantFixer;
use PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer;
use PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer;
use PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer;
use PhpCsFixer\Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer;
use PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer;
use PhpCsFixer\Fixer\Naming\NoHomoglyphNamesFixer;
use PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer;
use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer;
use PhpCsFixer\Fixer\Operator\NewWithBracesFixer;
use PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer;
use PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer;
use PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer;
use PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer;
use PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer;
use PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer;
use PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer;
use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocNoAccessFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocNoAliasTagFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer;
use PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer;
use PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer;
use PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer;
use PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer;
use PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer;
use PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer;
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
use PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer;
use PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer;
use PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer;
use PhpCsFixer\Fixer\Whitespace\LineEndingFixer;
use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer;
use PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer;
use PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer;
use PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer;
use PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer;
use PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer;

Our pipeline aborts with this error, which is probably more related to ECS itself, but its most likely caused by the errors I've pasted above:

[ERROR] Child process timed out after 120 seconds in                           
         /home/xxx/agent/workspace/xxx/pre-prod-pipeline/vendor/symplify/e
         asy-coding-standard/vendor/symplify/easy-parallel/src/ValueObject/Paral
         lelProcess.php:103                                                     


 [ERROR] Reached system errors count limit of 50, exiting...                    

PHP Version

PHP 8.0.24

Operating System

No response

@cmb69
Copy link
Member

cmb69 commented Sep 9, 2022

Now, if we want to run ECS with our fixers on our grown codebase, we see this in our local env:

Okay, but why is PHP-FPM involved here? Don't you run ECS from the command line?

@bytes-commerce
Copy link
Author

@cmb69 Hi Christoph, we do use a Docker PHP-FPM Container for all out environments, where in some this issue appears in the console, and in others ECS aborts due to ECS-based maximum error limits that we cannot reproduce locally for some reasoning.

@bytes-commerce
Copy link
Author

bytes-commerce commented Sep 16, 2022

I found the issue and its related likely to ECS rather than this repository.

I will leave my findings here for anybody else that stumbles upon it.

When you use Parallel Feature of ECS, and you have a huge codebase that you run it over, ECS will attempt to spawn children processes. ECS is configured to wait 120 seconds for children processes to finish which is an arbitrary value and not really working when you have a couple of thousand files. So, what happens? ECS aborts these processes after 120 seconds, thus its creating the errors from the console that I have posted above:

php-1             | [08-Sep-2022 15:51:10] ALERT: oops, unknown child (13559) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:11] ALERT: oops, unknown child (15507) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:12] ALERT: oops, unknown child (15525) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:13] ALERT: oops, unknown child (15538) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).
php-1             | [08-Sep-2022 15:51:13] ALERT: oops, unknown child (13560) exited with code 0. Please open a bug report (https://github.com/php/php-src/issues).

The solution for us was to change the ECS declaration in ecs.php to let the children processes run for at least 10 minutes (our codebase takes currently ~3 minutes with the current setup, so 10 minutes leave room for future files). We do it like so:

    $parameters = $ecsConfig->parameters();
    $parameters->set(Option::PARALLEL_TIMEOUT_IN_SECONDS, 600);

@bukka
Copy link
Member

bukka commented Jan 14, 2023

I have created an issue #10315 and PR #10319 that fixes it. This happened most likely due to some orphan process that got FPM master as a new parent because the master is an init process (PID 1) - that's how it runs in Docker where I assume the pipeline was running. The fix replaces the ALERT with DEBUG message for this case because it is really not a problem or something that can be changed. Please update this issue if you think that your issue is different.

Btw the fact that it stopped killing processes meant that it was just not happening for this particular case but there was still a bug in FPM in terms of displaying the alert - it should not really be displayed.

@bytes-commerce
Copy link
Author

Hey @bukka , thanks for still checking and figuring something out. MUCH appreciated. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants