-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Include vhost for RabbitMQ when retrieving queue info with useRegex #2591
Conversation
2284346
to
4603a4f
Compare
6adfe64
to
6b7bcee
Compare
a474e1d
to
d6a823f
Compare
@JorTurFer Any ideea why the test are failing now ? They passed yesterday and the only change I did was changelog |
Rerunning, it could be a transient error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Thanks for your contribution ❤️
Could you add any test to check this new feature please? I mean, to check that the vHost
is correctly appended to the url
I was not sure about the breaking change. I mean without vhost is the same but with vhost is not. I can move it to improvements, your call. We'll have a look at the tests next week |
That's why I said, if a user is already using rabbitmq with regex, |
Agree |
Is there a particular reason why is this marked as draft? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good,
@zroubalik I guess we marked it as draft because we were not sure if the tests are correct and then we could not change the status. |
/run-e2e rabbitmq-queue* |
/run-e2e rabbitmq-queue* |
@Photonios any update on this please? |
Sorry guys, we've been very busy and did not have time for this. I think some e2e tests need to be updated. We will try to have a look this week |
I'm not sure if the e2e test is wrong. I mean, the e2e test is testing regex without any vHost, so it should work in the same way even after your changes. Adding one e2e test to check the regex with vHost sounds good, but the current e2e test is testing the other scenario and we should keep it (or do a breaking change, but I think we should avoid it). |
After further investigations, I decided to rework the vhost computation part because the way it was computed in our previous commits completely removed the flow in which no vhost was provided (when the queue name regex was used). Indeed, this was the reason that led to the failing E2E test, but that was another problem that I tried to fix. The E2E test was created to test the case when a vhost and a queue name regex are provided, but the connection string omitted the vhost part, so the test was actually running on “All” vhosts, which led to the failure from our previous commits. I want to underline the fact that in my opinion, a new E2E test should be added, which will properly test the case with I spent some time in the RabbitMQ management console and I observed that if you're using any vhost (but the "All" option), the URL will contain the In the end, I want to mention that I tried to set up the environment locally in order to run the E2E tests, but I think I failed since on my local machine all tests were passing, except for the @JorTurFer can you please re-run the E2E tests? |
@@ -22,7 +22,7 @@ test.before(t => { | |||
|
|||
sh.config.silent = true | |||
// create deployment | |||
const httpConnectionString = `http://${username}:${password}@rabbitmq.${rabbitmqNamespace}.svc.cluster.local` | |||
const httpConnectionString = `http://${username}:${password}@rabbitmq.${rabbitmqNamespace}.svc.cluster.local/${vhost}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change needed? I mean, current test is working without this change. In fact, this change could hide the problem from my changes request.
If you want to test another feature, creating a new test is better.
This test checks that using an empty vHost (not in parameter but neither in connectionString), regex returns results from all vHosts, that's why the queues are under test-vh-regex
vHost and KEDA connectionString doesn't have any vHost.
Could you add another test case for this new case (regex inside a specific vHost)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, I think that the change in the code solves the problem, but I'd like to maintain and increase the e2e test suite instead of changing one for another
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a different point of view of that test and believed that the behavior you just described was not intended. Sure, I can undo the change and just duplicate the test for this behavior if you think that's ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDK if undo the change or simply adding other case with current behavior, but both behaviors should be tested IMO because in fact, that test discovered a breaking change.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you, both behaviors should be tested, that's why I created another test. Adding another case to the existing test should require calling the createDeployment
method twice and IMO the complexity of the test logic will grow, so I decided to keep things simple and just duplicate the test and set the parameters to validate the behavior with the connection string containing the vhost.
I don't believe the test discovered a breaking change. Before this fix we're trying to bring it in keda, the vhost part was completely ignored by the logic (when the regex was used for querying queue names). We just improved that flow and added support for that logic. The test was failing because initially, by adding this fix we removed the support for "All" vhosts, and the test was testing exactly that behavior. I fixed the problem and I improved the unit tests to ensure all 3 cases are tested:
- Using no vhost -
vhost = ""
(meaning "All" vhosts) - Using root vhost -
vhost = "/"
orvhost = "%2F"
- Using any vhost -
vhost = "some-vhost"
/run-e2e rabbitmq* |
hi @Photonios @valentindeaconu, |
The vhost is included when you don't use `useRegex: true`. It makes sense to have consistent behaviour between the two modes. Fixes kedacore#2498 Signed-off-by: Swen Kooij <swen@sectorlabs.ro>
Signed-off-by: Valentin Deaconu <valentin.deaconu@sectorlabs.ro>
Signed-off-by: Valentin Deaconu <valentin.deaconu@sectorlabs.ro>
Signed-off-by: Valentin Deaconu <valentin.deaconu@sectorlabs.ro>
Signed-off-by: Valentin Deaconu <valentin.deaconu@sectorlabs.ro>
Signed-off-by: Valentin Deaconu <valentin.deaconu@sectorlabs.ro>
Signed-off-by: Valentin Deaconu <valentin.deaconu@sectorlabs.ro>
dbfae76
to
7692edf
Compare
/run-e2e rabbitmq* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Only 2 nits:
- Please add the issue instead of the PR to the changelog (we have changed that system some days ago 😄 )
- Related with e2e test, Could you create the dummy queues in different vHost and push message to all of them? I mean, instead of adding dummy queues to the same vHost that you are using for scaling, in others. With this change you will test that regex only applies to your vHost
BTW. Thanks a ton for this contribution and for all the effort that you have done ❤️ ❤️ ❤️ ❤️
Signed-off-by: Valentin Deaconu <valentin.deaconu@sectorlabs.ro>
fd8918d
to
14f32c4
Compare
Signed-off-by: Valentin Deaconu <valentin.deaconu@sectorlabs.ro>
45ef243
to
03f8642
Compare
Signed-off-by: Valentin Deaconu <valentin.deaconu@sectorlabs.ro>
Sure, I pushed the changes. We're glad we could fix this problem so we can both benefit from it. Will it be possible to have a bug-fix release containing this PR? We'll need it soon and doing a local build will require a lot of extra work. |
Signed-off-by: Valentin Deaconu <valentin.deaconu@sectorlabs.ro>
/run-e2e rabbit* |
Hey, unluckily that's not possible because in fact, this is not a bug-fix, it's a new feature. :( I'd suggest to, after this PR is merged (and the image generated) pull it from KEDA's register, push it into one registry under your control and use that registry in your scenario till next version. With this approach, you will not need to build it from scratch by your self and you'll have a frozen version till next release in 2 months. Other option could be use the image's sha instead of the tag for pulling always the same image but IDK if we could delete old images untagged sometime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just to interject here, the RabbitMQ scaler has two relevant features:
[...] is text I added to clarify/frame the two features better for this discussion, the rest is quoted directly from the documentation. The documentation does not say anywhere that these two features are incompatible. As such, the fact that these two features are incompatible is a bug: either a documentation bug or an application bug, depending on how you choose to see it. Because of this, people will continue trying to use these two features together, perceiving the results as a bug until they search around enough to find this PR or the issue from which it stems. The perception of a bug on the part of all users with this particular (not unusual or unexpected) use case would generally be a good argument for treating the feature-gap as a bug: either patching the documentation to highlight the incompatibility, or (as the application fix is already complete) patching the application between minor releases. |
Okey, |
Fair enough. I can't see a discussion of your policy on patch releases in the linked governance repo, but I can see your most recent patch release was a week or two after your latest minor version release. That patch had a small number of small updates, such as a fix to an e2e test. The main fix seems to be to avoid sometimes-flaky behaviour when there are multiple triggers for a single scaled object. I assume that that gives an idea of the impact threshold past which you will do a patch release. |
just for clarifying, any extra release could be done if @kedacore/keda-maintainers agree with it. 😄 v2.6.1 was released with the agreement of maintainers for solving a critical bug in the own core which affected whole the service after hard work before release v2.6.0 solving other bugs related with the cache in the core. In this case, the potential impact of the error seems lower, so using the workaround for having this patch sounds reasonable. Using |
…edacore#2591) Signed-off-by: SushmithaVReddy <sushmithavangala@gmail.com>
…edacore#2591) Signed-off-by: Ram Cohen <ram.cohen@gmail.com>
The vhost is included when you don't use
useRegex: true
. It makessense to have consistent behaviour between the two modes.
Fixes #2498
Provide a description of what has been changed
Checklist
Fixes #