I'm running a Lambda function that uses SQS triggers set to a visibility timeout of 1 minute, with an execution timeout also at 1 minute. The issue I'm facing is that even if my function processes its current batch in less than 10 seconds, it doesn't pick up another batch until after the visibility timeout of 1 minute has elapsed. I'm looking for advice on whether there's something I might not be returning in my Lambda function that would allow it to trigger another execution right away, or if this is more of a configuration issue with the SQS event trigger. Just to clarify, my batch window is set to 0 seconds, and I have reserved concurrency set to 1 due to limitations with a third-party API.
5 Answers
You might want to check if you're properly acknowledging the messages with something like `message.delete()`. Just a thought.
What type of SQS queue are you using, Standard or FIFO? Just checking if that might have an impact.
Actually, you don't need to worry about deleting messages yourself. Lambda manages that automatically. If your function completes without any exceptions, the message gets deleted. It sounds like the reserved concurrency setting is causing the delay. With it set to 1, Lambda won't trigger a new execution until the timeout expires, which is why you're waiting for a minute.
Your visibility timeout should ideally be at least six times longer than your function timeout. Having a reserved concurrency of 1 might lead to throttling issues. You could try increasing the visibility timeout to 6 minutes and consider using a FIFO queue with a single message group ID to maintain a single execution.
Is your `MaximumBatchingWindowInSeconds` set to zero? It sounds like that could cause issues. Can you share your event source mapping configuration? It might help figure this out.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically