Skip to content

Process Manager doesn't handle exceptions properly in forked processes #30622

Closed
@pawel-siejba

Description

@pawel-siejba

The following bug can have fatal consequences if somebody employed any form of exception handling around indexers in their installation, as it could lead to very hard to discover bugs, that appear only on environments with several threads available, and MAGE_INDEXER_THREADS_COUNT env variable set.

Preconditions (*)

  1. Magento 2.3.0 CE/EE or higher
  2. Magento 2.4-develop
  3. Several stores are active
  4. (Optional) Elasticsearch is configured as search_engine - for ease of reproducing

Steps to reproduce (*)

  1. Run MAGE_INDEXER_THREADS_COUNT=4 php bin/magento indexer:reindex catalogsearch_fulltext
  2. Kill Elasticsearch process to simulate an exception thrown

Expected result (*)

  1. Main process exits and the message is displayed only once, the exceptions from the forked processes are not handled as they were thrown in the main process.

Actual result (*)

  1. Observe multiple Indexer failure logs and messages
xx@xx:/var/www/magento2$ MAGE_INDEXER_THREADS_COUNT=4 php bin/magento indexer:reindex catalogsearch_fulltext
Catalog Search indexer process unknown error:
Indexer handler is not available: elasticsearch7
Catalog Search indexer process unknown error:
Indexer handler is not available: elasticsearch7
Catalog Search indexer process unknown error:
Indexer handler is not available: elasticsearch7
Catalog Search indexer process unknown error:
Indexer handler is not available: elasticsearch7
Catalog Search indexer process unknown error:
Catalog Search indexer process unknown error:
Catalog Search indexer process unknown error:
Indexer handler is not available: elasticsearch7
Indexer handler is not available: elasticsearch7
Indexer handler is not available: elasticsearch7
Catalog Search indexer process unknown error:
Fail in child process

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Event: MageCONF CD 2020Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneReported on 2.3.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S0A problem that is blocking the ability to work. An immediate fix is needed.Severity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions