-
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
fix(nats-jetstream): correctly count messages that should be redelivered (waiting for ack) towards keda value #3809
fix(nats-jetstream): correctly count messages that should be redelivered (waiting for ack) towards keda value #3809
Conversation
0cf7bbc
to
1d259f3
Compare
@JorTurFer That was a pretty straightforward fix after all :). |
/run-e2e nats* |
@JorTurFer e2e passed, I checked the last point in the list to make the PR checks happy and updated the branch. |
@toniopelo could you please rebase this PR? I think we can merge it then. Thanks! |
…t of pending messages used for scaling Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com>
Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com>
8735888
to
9ed545e
Compare
@zroubalik Nice! Just rebased it :) |
/run-e2e nats* |
When can I expect this to be released @JorTurFer ? |
Hi @toniopelo , |
Hi @JorTurFer, thanks for the information, that's crystal clear! |
You're welcome, happy to help |
…red (waiting for ack) towards keda value (kedacore#3809) * fix: keda now include the messages that should be retried in the count of pending messages used for scaling Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> * chore: update changelog Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com>
…red (waiting for ack) towards keda value (kedacore#3809) * fix: keda now include the messages that should be retried in the count of pending messages used for scaling Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> * chore: update changelog Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> Signed-off-by: Pedro Tanaka <pedro.stanaka@gmail.com>
…red (waiting for ack) towards keda value (kedacore#3809) * fix: keda now include the messages that should be retried in the count of pending messages used for scaling Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> * chore: update changelog Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> Signed-off-by: Pedro Tanaka <pedro.stanaka@gmail.com>
…red (waiting for ack) towards keda value (kedacore#3809) * fix: keda now include the messages that should be retried in the count of pending messages used for scaling Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> * chore: update changelog Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> Signed-off-by: Pedro Tanaka <pedro.stanaka@gmail.com>
* fix: CVE-2022-3172 (#3693) Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com> * fix: Respect optional parameter inside envs for ScaledJobs (#3694) Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es> Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com> * fix(prometheus scaler): Detect Inf before casting float to int (#3762) * fix(prometheus scaler): Detect Inf before casting float to int Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es> * Improve the log message Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es> Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es> Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com> * fix(nats-jetstream): correctly count messages that should be redelivered (waiting for ack) towards keda value (#3809) * fix: keda now include the messages that should be retried in the count of pending messages used for scaling Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> * chore: update changelog Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> Signed-off-by: Pedro Tanaka <pedro.stanaka@gmail.com> * NewRelic scaler crashes on logging (#3946) Signed-off-by: Laszlo Kishalmi <laszlo.kishalmi@partech.com> Signed-off-by: Laszlo Kishalmi <laszlo.kishalmi@partech.com> Signed-off-by: Pedro Tanaka <pedro.stanaka@gmail.com> Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com> * Fix stackdriver client returning 0 for metric types of double (#3788) * Update stackdriver client to handle metrics of value type double Signed-off-by: Eric Takemoto <24865872+octothorped@users.noreply.github.com> * move change log note to below general Signed-off-by: Eric Takemoto <24865872+octothorped@users.noreply.github.com> * parse activation value as float64 Signed-off-by: Eric Takemoto <24865872+octothorped@users.noreply.github.com> * change target value to float64 for GCP pub/sub and stackdriver Signed-off-by: Eric Takemoto <24865872+octothorped@users.noreply.github.com> Signed-off-by: Eric Takemoto <24865872+octothorped@users.noreply.github.com> Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com> * Fixing conflicts after cherry-pick Signed-off-by: Pedro Tanaka <pedro.stanaka@gmail.com> * fix: Close is called twice on PushScaler's deletion (#3599) Signed-off-by: ytz <1020560484@qq.com> Signed-off-by: taenyang <1020560484@qq.com> Signed-off-by: Pedro Tanaka <pedro.stanaka@gmail.com> * fix/datadog-scaler-null-last-point (#3954) Signed-off-by: Tony Lee <dogzzdogzz@gmail.com> Signed-off-by: Tony Lee <tony.lee@shopback.com> Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com> Co-authored-by: Tony Lee <tony.lee@shopback.com> Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com> Signed-off-by: Pedro Tanaka <pedro.stanaka@gmail.com> * fix(mongodb): escape username and password (#3989) Fixes #3992 Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com> * Hacking generated files to version CI expects Signed-off-by: Pedro Tanaka <pedro.stanaka@gmail.com> * Updating aws-sdk and golang packages to fix CVEs Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com> * Updating golang/text package to fix CVE Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com> * Using same version of aws sdk as in main Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com> Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com> Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es> Signed-off-by: Antoine Laffargue <antoine.laffargue@gmail.com> Signed-off-by: Pedro Tanaka <pedro.stanaka@gmail.com> Signed-off-by: Laszlo Kishalmi <laszlo.kishalmi@partech.com> Signed-off-by: Eric Takemoto <24865872+octothorped@users.noreply.github.com> Signed-off-by: ytz <1020560484@qq.com> Signed-off-by: taenyang <1020560484@qq.com> Signed-off-by: Tony Lee <dogzzdogzz@gmail.com> Signed-off-by: Tony Lee <tony.lee@shopback.com> Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com> Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Co-authored-by: Antoine LAFFARGUE <antoine.laffargue@gmail.com> Co-authored-by: Laszlo Kishalmi <laszlo.kishalmi@gmail.com> Co-authored-by: Eric Takemoto <eric.takemoto@gocrisp.com> Co-authored-by: taenyang <1020560484@qq.com> Co-authored-by: Tony Lee <dogzzdogzz@gmail.com> Co-authored-by: Tony Lee <tony.lee@shopback.com> Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com>
Until now, the keda nats jetstream scaler did only use the
num_pending
value returned by the nats monitoring endpoint for a specifc consumer. The problem was that messages that should be re-delivered (retried) are not returned as part of thenum_pending
counter but they are in a separate counter callednum_ack_pending
.This PR use the sum of these two counter to determine the value that should be used by keda instead of only the
num_pending
value.This fixes two problems:
num_pending
counter and increment thenum_ack_pending
counter. Keda would then think that there is no work to be done and scale down the deployment/job that are still processing the messages (after a cooldown time if setup).Checklist
Fixes #3787
Relates to #