1 Answer
- Newest
- Most votes
- Most comments
0
There is no specific priority. The behavior depends on invocation type.
For Asynchronous invocation, the invocation event is added to an internal queue. We then process all the messages in the internal queue. If we try to invoke a function and it already at its limit, we will retry the invocation.
For synchronous invocations (e.g., CLI), if we are at the limit, we return an error. It is up to the client to retry.
For poll based invocations (e.g., SQS), there is a fleet of pollers reading from the queue and trying to invoke the function synchronously. If at the limit, the pollers will retry.
In your case, we can't really tell. It is really timing.
Relevant content
- AWS OFFICIALUpdated 2 years ago
Hey Uri. I'm hoping you can confirm my understanding of what you said here. You say that Lambda has an internal queue. Is that internal queue always prioritized over other source (e.g. SQS). So if I make an Asynchronous invocation and the function is below its limit, that event starts immediately? If I make an Asynchronous invocation and the function is already at its limit, it will be run before events from SQS when a concurrency unit becomes available?
No. There is no notion of priority. If you have a message in the internal queue (async invocation) and a message in an SQS queue, and maybe also some sync invocation from API gateway, and let's assume that one instance becomes available, the first to catch it wins.