Skip to content

Handling exception on individual callback #27134

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

Merged
merged 7 commits into from
May 21, 2020
Merged

Conversation

alok0590
Copy link
Member

@alok0590 alok0590 commented Mar 3, 2020

Description

This PR changes the behaviour how callbacks are executed after DB changes are committed. The issue was if there is an exception from one call back it results in failing other callbacks as well.

So put the try/catch on individual callback instead of entire foreach block.

Manual testing scenarios (*)

  1. Have multiple callbacks having one with fatal error.
  2. The subsequenct callbackss after one with fatal error won't get executed.

Resolved issues:

  1. resolves [Issue] Handling exception on individual callback #28167: Handling exception on individual callback

@m2-assistant
Copy link

m2-assistant bot commented Mar 3, 2020

Hi @alok0590. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @alok0590,
Your changes looks good.
Could you sign Adobe CLA, fix static tests and cover your changes with some tests?

@ihor-sviziev ihor-sviziev added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Mar 4, 2020
@engcom-Charlie engcom-Charlie self-assigned this Mar 13, 2020
ihor-sviziev
ihor-sviziev previously approved these changes Mar 18, 2020
@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-7136 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@alok0590 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@engcom-Charlie engcom-Charlie added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests and removed Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests labels Mar 18, 2020
@ihor-sviziev ihor-sviziev added the Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. label Apr 28, 2020
@engcom-Charlie
Copy link
Contributor

✔️ QA Passed
For example, we have 4 callbacks and the first callback has a fatal error.
Before: The critical exception was logged and the next callbacks don't execute.
After: The critical exception was logged and next callbacks execute.

@slavvka slavvka added this to the 2.4.1 milestone May 8, 2020
@alok0590
Copy link
Member Author

@slavvka @ihor-sviziev Anything I need to do to get this PR merged ?

@ihor-sviziev
Copy link
Contributor

@alok0590 for now no actions required from your side.

Copy link
Member

@slavvka slavvka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alok0590 please resolve the conflicts and re-run tests after upgrade to PHP 7.4

Copy link
Member

@slavvka slavvka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alok0590 please resolve the conflicts and re-run tests after upgrade to PHP 7.4

@ghost ghost dismissed ihor-sviziev’s stale review May 12, 2020 18:09

Pull Request state was updated. Re-review required.

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-7136 has been created to process this Pull Request

@engcom-Charlie
Copy link
Contributor

✔️ QA Passed
For example, we have 4 callbacks and the first callback has a fatal error.
Before: The critical exception was logged and the next callbacks don't execute.
After: The critical exception was logged and next callbacks execute.

@engcom-Charlie
Copy link
Contributor

Failed functional test not related to changes from this PR.

@slavvka slavvka merged commit 4855a09 into magento:2.4-develop May 21, 2020
@m2-assistant
Copy link

m2-assistant bot commented May 21, 2020

Hi @alok0590, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team magento-engcom-team added QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope and removed QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) labels May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Component: Model Priority: P3 May be fixed according to the position in the backlog. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Handling exception on individual callback
5 participants