Azure / Azure/azure-functions-host
Unexpected delay before message processing in EventGridTrigger
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 36
Description
#### Is your question related to a specific version? If so, please specify:
```xml
netcoreapp3.1
v3
```
#### What language does your question apply to? (e.g. C#, JavaScript, Java, All)
C#
#### Question
I see that the code execution time inside the Azure Function is 2s, but event handler shows that the total time is a few minutes
Why do some messages from EventGrid are waiting so long before start actual processing?
```cs
public class Handler
{
[FunctionName("Handler")]
[Singleton]
public async Task Run([EventGridTrigger] EventGridEvent eventGridEvent, ILogger log)
{
log.LogInformation("Event:");
}
}
```


Contributor guide
Research direction
Start with the EventGridTrigger binding and the [Singleton] attribute in Handler.Run, then compare the reported two-second function execution with the event-handler timestamps. Determine where the queueing delay occurs and document the cause or required configuration; the issue is done when the delay is explained and a reproducible resolution is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100