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

Having no tries option in the supervisor causes unlimited tries #1076

Closed
shivampawstickee opened this issue Sep 24, 2021 · 6 comments
Closed

Comments

@shivampawstickee
Copy link

  • Horizon Version: 5.7.13
  • Laravel Version: 8.49.2
  • PHP Version: 7.4

Description:

When there is no tries option set the SupervisorOptions class defaults $maxTries to 0 which causes an infinite loop when jobs fail.

Is this intended? My hunch is it isn't because in Illuminate\Queue\WorkerOptions the default is 1

I know that tries is set in the config file by default, but it still feels incorrect to me to have unlimited retries allowed?

Happy to create a PR if it is agreed this needs addressing.

@driesvints
Copy link
Member

Hi there,

Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.

@shivampawstickee
Copy link
Author

shivampawstickee commented Sep 27, 2021

I don't see how this isn't a bug? The current behaviour means leaving the tries field out of the supervisor config causes an infinite amount of attempts for a failed job. @driesvints

@matheusb-comp
Copy link

matheusb-comp commented Aug 30, 2023

@driesvints, I also think this is a bug.
In the Queue module of the framework, the default changed from 0 to 1 since version 6.0.

Also, in Horizon since version 3.0 the default tries in the config file changed to 1.
It just seems very strange to have a different default in Horizon only for this attribute.

@driesvints
Copy link
Member

Hey all. Sorry for neglecting this a bit. What do you recommend for fixing this? Having a better fallback? In general we don't recommend removing the tries field or setting it to zero.

@matheusb-comp
Copy link

Having a better fallback?

I think just changing the $maxTries default value from 0 to 1, to match the $maxTries default value in Illuminate/Queue/WorkerOptions.php.

Since all the other default values are the same in both files, as @shivampawstickee said, it just does not seem intended to be 0.

@driesvints
Copy link
Member

If you could PR that (probably to master because it'll be a breaking change) with a thorough explanation for Taylor, he could have a look 👍

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

No branches or pull requests

3 participants