-
Notifications
You must be signed in to change notification settings - Fork 332
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
MaxRetryHandler tries to set wrong x-dead-letter-exchange value #442
Comments
I realized there is something flawed with the #376 logic when I tried to fix the problem. In Sneakers, we can configure max_retry_handler by setting retry_exchange, retry_error_exchange, retry_requeue_exchange in the global configuration.
The newly defined configure_queue method on line 85 of maxretry.rb tries to retrieve the :retry_exchage.
Now the problem part is line 37 of queue.rb where it is passing :queue_options as opt arg to configure_queue method.
The configure_queue method will look for :retry_exchange value from queue_options instead of global options.
The queue_options we set in global should be just the DEFAULT options. I don't think it should contain any handler specific stuff that belongs in individual workers that implements whatever handlers. The change in #376 also overwrites any queue arguments as well (hence #427 but it doesn't address the main problem). I think best thing to do is to revert this change. |
Is to revert what change specifically? Unfortunately reverting it would also be a breaking change. The question at this point should be: how many people would be affected in each case. |
The change I'm referring to is the entire #376. And whoever is using it with If it didn't break for them, reverting won't break them either. And having to define retry_exchange value in multiple places is not an ideal solution. If not reverting, then it should be fixed to not overwrite argument (#427) AND x-dead-letter-exchange value if specified. In any case, it should pass the entire @opts to get correct :retry_exchange value. |
Would you be interested in submitting a PR that does that and adds some relevant tests? This is open source software after all. |
I had a feeling you were gonna suggest that. |
As soon as we have this PR in :) we don't do calendar-based releases FWIW. |
Looks like this was introduced in version 2.12.0.
I had previously defined retry queues and exchanges as follows:
exchanges:
queues:
And from all other queues (lets say these are worker queues), the x-dead-letter-exchange is set to 'activejob-retry'
Now, the MaxRetryHandler has a new convenience method 'configure_queue' that tries to set x-dead-letter-exchange and it is using the queue names instead even though I have 'retry_exchange' configuration option defined.
Thus I get the following error: (lets say the queue is 'mailer')
Unexpected error PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-exchange' for queue 'mailer' in vhost '/': received 'mailer-retry' but current is 'activejob-retry'
I am also passing the x-dead-letter-exchange value as arguments but it is ignored.
#376 introduced it
#427 does not fix it
The text was updated successfully, but these errors were encountered: