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

SQS Trigger never executes #567

Closed
mmmoli opened this issue Dec 18, 2024 · 7 comments
Closed

SQS Trigger never executes #567

mmmoli opened this issue Dec 18, 2024 · 7 comments
Labels
area/plugin Plugin-related issue or feature request bug Something isn't working

Comments

@mmmoli
Copy link

mmmoli commented Dec 18, 2024

Describe the issue

Take this flow:

id: sqs
namespace: demo

tasks:
  - id: log_trigger
    type: io.kestra.plugin.core.log.Log
    message: "{{trigger.data}}"

triggers:
  - id: "realtime_trigger"
    type: io.kestra.plugin.aws.sqs.RealtimeTrigger
    accessKeyId: "{{ envs.aws_sqs_access_key_id }}"
    secretKeyId: "{{ envs.aws_sqs_secret_access_key }}"
    region: "{{ envs.aws_sqs_region }}"
    queueUrl: "{{ envs.aws_sqs_url_instruct_kestra }}"
    serdeType: JSON
    waitTime: "20.0000"
    maxNumberOfMessage: 10
  • Send a message.
  • No flow executes.
  • Head over the Administration > Trigger.
  • Hit "Unlock trigger" Button (don't know what this does).
  • Check back at executions
  • No flow executes

Logs show 243 entries of:

2024-12-18 14:20:31.881demosqsrealtime_trigger
[namespace: [demo](http://localhost:8080/ui/flows?namespace=demo)] [flow: [sqs](http://localhost:8080/ui/flows/edit/demo/sqs)] [trigger: realtime_trigger] Type io.kestra.plugin.aws.sqs.RealtimeTrigger started
2024-12-18 14:20:29.966demosqsrealtime_trigger
Unable to execute HTTP request: Acquire operation took longer than the configured maximum time. This indicates that a request cannot get a connection from the pool within the specified maximum time. This can be due to high request rate.
 Consider taking any of the following actions to mitigate the issue: increase max connections, increase acquire timeout, or slowing the request rate.
 Increasing the max connections can increase client throughput (unless the network interface is already fully utilized), but can eventually start to hit operation system limitations on the number of file descriptors used by the process. If you already are fully utilizing your network interface or cannot further increase your connection count, increasing the acquire timeout gives extra time for requests to acquire a connection before timing out. If the connections doesn't free up, the subsequent requests will still timeout.
 If the above mechanisms are not able to fix the issue, try smoothing out your requests so that large traffic bursts cannot overload the client, being more efficient with the number of times you need to call AWS, or by increasing the number of hosts sending requests.
 Acquire operation took longer than the configured maximum time. This indicates that a request cannot get a connection from the pool within the specified maximum time. This can be due to high request rate.
 Consider taking any of the following actions to mitigate the issue: increase max connections, increase acquire timeout, or slowing the request rate.
 Increasing the max connections can increase client throughput (unless the network interface is already fully utilized), but can eventually start to hit operation system limitations on the number of file descriptors used by the process. If you already are fully utilizing your network interface or cannot further increase your connection count, increasing the acquire timeout gives extra time for requests to acquire a connection before timing out. If the connections doesn't free up, the subsequent requests will still timeout.
 If the above mechanisms are not able to fix the issue, try smoothing out your requests so that large traffic bursts cannot overload the client, being more efficient with the number of times you need to call AWS, or by increasing the number of hosts sending requests.
 Acquire operation took longer than 5000 milliseconds.
2024-12-18 14:20:29.966[demo](http://localhost:8080/ui/flows?namespace=demo)sqsrealtime_trigger
[namespace: demo] [flow: [sqs](http://localhost:8080/ui/flows/edit/demo/sqs)] [trigger: realtime_trigger] [date: 2024-12-18T07:15:55.031Z] Trigger evaluation failed in the worker with error: software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: Acquire operation took longer than the configured maximum time. This indicates that a request cannot get a connection from the pool within the specified maximum time. This can be due to high request rate.
 Consider taking any of the following actions to mitigate the issue: increase max connections, increase acquire timeout, or slowing the request rate.
 Increasing the max connections can increase client throughput (unless the network interface is already fully utilized), but can eventually start to hit operation system limitations on the number of file descriptors used by the process. If you already are fully utilizing your network interface or cannot further increase your connection count, increasing the acquire timeout gives extra time for requests to acquire a connection before timing out. If the connections doesn't free up, the subsequent requests will still timeout.
 If the above mechanisms are not able to fix the issue, try smoothing out your requests so that large traffic bursts cannot overload the client, being more efficient with the number of times you need to call AWS, or by increasing the number of hosts sending requests.

Environment

Tried with kestra:v0.20.6 and kestra:develop

@mmmoli mmmoli added area/plugin Plugin-related issue or feature request bug Something isn't working labels Dec 18, 2024
@kestrabot kestrabot bot added this to Issues Dec 18, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Issues Dec 18, 2024
@anna-geller
Copy link
Member

Could you try the same with maxNumberOfMessage: 1? I believe it might have sth to do with your trigger waiting for 10 messages, so with 1, it will be easier to test

mmmoli added a commit to mmmoli/plugin-aws that referenced this issue Dec 18, 2024
Attempt to limit the requests hitting aws.
@anna-geller
Copy link
Member

related #568

@mmmoli
Copy link
Author

mmmoli commented Dec 18, 2024

Could you try the same with maxNumberOfMessage: 1? I believe it might have sth to do with your trigger waiting for 10 messages, so with 1, it will be easier to test

Thanks for coming back. Same issue.

@mmmoli
Copy link
Author

mmmoli commented Dec 18, 2024

Suspect it's more to do with how SQS is polled a while loop. I attempted to push a fix.

@anna-geller
Copy link
Member

gotcha, do you want to contribute a PR from your fork?

@mmmoli
Copy link
Author

mmmoli commented Dec 18, 2024

gotcha, do you want to contribute a PR from your fork?

Happy to but it needs a review from someone who knows what they're doing.

I'll make it so we can review

  • I don't have the build tools installed so I don't know if my PR compiles
  • I don't know how to mount my fork into Kestra so I don't even know if it fixes the problem

@mmmoli
Copy link
Author

mmmoli commented Dec 19, 2024

fixed by #571

@mmmoli mmmoli closed this as completed Dec 19, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Issues Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugin Plugin-related issue or feature request bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants