Skip to content
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

When using MysqlMQ messages are always set to complete even if exception occurs #18140

Closed
php4umagento opened this issue Sep 19, 2018 · 11 comments · Fixed by #31480
Closed

When using MysqlMQ messages are always set to complete even if exception occurs #18140

php4umagento opened this issue Sep 19, 2018 · 11 comments · Fixed by #31480
Assignees
Labels
CD Issue recommended for the contribution day Component: Backend Event: dmcdindia2020 Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S1 Affects critical data or functionality and forces users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@php4umagento
Copy link
Contributor

php4umagento commented Sep 19, 2018

Preconditions (*)

  1. Magento 2.3 and 2.4-develop
  2. Using mysql mq driver to work with the queue

Steps to reproduce (*)

  1. Publish any message to the queue
  2. In the consumer throw Exception

Expected result (*)

1.Message should be flagged as error in the queue

Actual result (*)

  1. Message is set to complete and ACK

Problem is here -

When exception happens in the Consumer message is flagged as error here
https://github.com/magento/magento2/blob/2.4-develop/lib/internal/Magento/Framework/MessageQueue/Consumer.php#L229

but then this status is overwritten by

https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/MysqlMq/Model/Driver/Queue.php#L114

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Sep 19, 2018
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Sep 19, 2018

Hi @php4umagento. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@php4umagento do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@ghost ghost self-assigned this Sep 20, 2018
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Sep 20, 2018

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label G1 Passed will be added to the issue automatically. Please, edit issue description if needed, until label G1 Passed appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add G2 Passed label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label acknowledged once verification is complete.

  • 7. Make sure that automatic system confirms that report is acknowledged.

@ghost ghost added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Fixed in 2.2.x The issue has been fixed in 2.2 release line Component: Backend Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Sep 20, 2018
@magento-engcom-team
Copy link
Contributor

@engcom-backlog-nazar Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-95138 were created

@ghost ghost removed their assignment Sep 20, 2018
@vdubyna
Copy link

vdubyna commented Jul 31, 2019

The issue still exists in 2.3.2, the only thing needed to fix it is to update the lock resource
and set lock_id to lock

   /**
     * {@inheritDoc}
     */
    public function saveLock(\Magento\Framework\MessageQueue\LockInterface $lock)
    {
        $object = $this->lockFactory->create();
        $object->setMessageCode($lock->getMessageCode());
        $object->setCreatedAt($this->dateTime->gmtTimestamp());
        $object->save();
        // After save we set lock id to lock object
        $lock->setId($object->getId());
    }

@engcom-Charlie engcom-Charlie self-assigned this Dec 27, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 27, 2019

Hi @engcom-Charlie. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@engcom-Charlie engcom-Charlie added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch and removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Dec 27, 2019
@ghost ghost unassigned engcom-Charlie Dec 27, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Charlie
Thank you for verifying the issue. Based on the provided information internal tickets MC-30104 were created

Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Dec 27, 2019
@magento-engcom-team magento-engcom-team added this to Ready for Dev in Community Backlog Mar 24, 2020
@sidolov sidolov added this to Ready for Grooming in Low Priority Backlog Sep 3, 2020
@sdzhepa sdzhepa added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Sep 22, 2020
@sidolov sidolov added this to Ready for Development in Low Priority Backlog Sep 24, 2020
@gabrieldagama gabrieldagama added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Sep 29, 2020
@sidolov sidolov added this to Dev In Progress in High Priority Backlog Oct 20, 2020
@ghost ghost removed this from Ready for Dev in Community Backlog Oct 20, 2020
@ghost ghost removed this from Dev In Progress in Low Priority Backlog Oct 20, 2020
@ghost ghost unassigned geet07 Nov 4, 2020
@m2-community-project m2-community-project bot moved this from Dev In Progress to Ready for Development in High Priority Backlog Nov 4, 2020
@dineshvb
Copy link

dineshvb commented Dec 1, 2020

@magento I am working on this

@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in High Priority Backlog Dec 1, 2020
@dineshvb
Copy link

The issue still exists in 2.3.2, the only thing needed to fix it is to update the lock resource
and set lock_id to lock

   /**
     * {@inheritDoc}
     */
    public function saveLock(\Magento\Framework\MessageQueue\LockInterface $lock)
    {
        $object = $this->lockFactory->create();
        $object->setMessageCode($lock->getMessageCode());
        $object->setCreatedAt($this->dateTime->gmtTimestamp());
        $object->save();
        // After save we set lock id to lock object
        $lock->setId($object->getId());
    }

Hi @vdubyna, can I add this line and give a PR? Will it resolve the issue?

@dineshvb dineshvb removed their assignment Dec 22, 2020
@m2-community-project m2-community-project bot moved this from Dev In Progress to Ready for Development in High Priority Backlog Dec 22, 2020
@engcom-Golf engcom-Golf self-assigned this Dec 24, 2020
@m2-assistant
Copy link

m2-assistant bot commented Dec 24, 2020

Hi @engcom-Golf. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

    1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
    1. If the issue is not relevant or is not reproducible any more, feel free to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CD Issue recommended for the contribution day Component: Backend Event: dmcdindia2020 Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S1 Affects critical data or functionality and forces users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
10 participants