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 a job fails it tries to reject it twice. #322

Merged
merged 1 commit into from
May 10, 2020
Merged

When a job fails it tries to reject it twice. #322

merged 1 commit into from
May 10, 2020

Conversation

phalouvas
Copy link
Contributor

When a job fails in Consumer.php the override of function markJobAsFailedIfWillExceedMaxAttempts causes job to try to reject twice resulting failure on the consumer, due to false tag message.

This occurs only if the job running throw exception for some reason. Above fix remove that function. After that it works as expected.

@vyuldashev
Copy link
Owner

Try v10.2.0

@phalouvas
Copy link
Contributor Author

phalouvas commented Apr 28, 2020 via email

@adm-bome
Copy link
Collaborator

adm-bome commented May 3, 2020

@vyuldashev @phalouvas I think this can be closed

@phalouvas
Copy link
Contributor Author

Did not manage to test so far, but you can close it since it passed all your tests. If I find something in the future, will let you know.

@adm-bome adm-bome closed this May 4, 2020
@adm-bome
Copy link
Collaborator

adm-bome commented May 4, 2020

As of v10.2.0 the library strategy is different. I think this issue is resolved.

May you still find yourself having this issue, dont hesitate to mention this in this issue.

@phalouvas
Copy link
Contributor Author

Unfortunately problem still exists with new version 10.2.

if you start the consumer with php artisan rabbitmq:consume --queue=default --tries=3
and a job throws exception, it does not rerun. It gives this: https://1drv.ms/u/s!AljvtJPILTC7gZ_LM-EJmK5XartGhQg?e=C0K38m

@adm-bome adm-bome reopened this May 6, 2020
adm-bome
adm-bome previously approved these changes May 6, 2020
Copy link
Collaborator

@adm-bome adm-bome left a comment

Choose a reason for hiding this comment

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

Your right ;)
Overlooked with the latest refactor. The method has no meaning anymore.

@adm-bome adm-bome added the bug label May 6, 2020
@adm-bome adm-bome dismissed their stale review May 7, 2020 08:30

Further testing is needed.

@adm-bome
Copy link
Collaborator

adm-bome commented May 7, 2020

I have one question, when removing this method, what happens with the message in RabbitMQ?
Because an error occurs, the message must not be lost within the process.
It must either be released or deleted.

As the message can't be handled twice: Where did it go or what happened to the message?

@vyuldashev
Was there a special case why these extra lines were added into this method?

@phalouvas
Copy link
Contributor Author

phalouvas commented May 8, 2020

@adm-bome if I remember correctly the job is removed. Not 100% sure though. Need to test again to see. In any case the whole thing needs revision.

That goes for adding delay before rerun etc

@adm-bome
Copy link
Collaborator

adm-bome commented May 8, 2020

I will look into the consumer part, somewere in the next 3 days. Some rework must be done.

The consumer is an extra addition to the queue driver part. Without the consumer the lib still works. ;)

Copy link
Collaborator

@adm-bome adm-bome left a comment

Choose a reason for hiding this comment

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

Method can be removed. The code after parent call does conflict with the consumer/worker code and the strategy to reject or release the Job message.

The message is released into the queue

@vyuldashev vyuldashev merged commit d8fdfc1 into vyuldashev:master May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants