Azure / Azure/azure-functions-host

Unexpected delay before message processing in EventGridTrigger

Open
#6,802 18 comments 4 reactions 0 assignees View on GitHub
Needs: Attention :wave:
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:");
}
}
```

![image](https://user-images.githubusercontent.com/53045642/96262056-8c301c00-0fc1-11eb-9280-d3ae53329fa6.png)
![image](https://user-images.githubusercontent.com/53045642/96262939-b504e100-0fc2-11eb-908f-87397db69a2d.png)

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.