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

Duplicate Messages from SignalEntityAsync #394

Closed
alexjebens opened this issue May 6, 2024 · 2 comments
Closed

Duplicate Messages from SignalEntityAsync #394

alexjebens opened this issue May 6, 2024 · 2 comments
Labels
wontfix This will not be worked on

Comments

@alexjebens
Copy link

alexjebens commented May 6, 2024

We are seeing duplicate messages from starter functions.

[FunctionName("Process")]
public async Task<IActionResult> Run(
    [HttpTrigger(AuthorizationLevel.Anonymous, "post", "patch", "put", Route = null)] HttpRequest req,
    [DurableClient] IDurableEntityClient client)
{
    var process = JsonConvert.DeserializeObject<Process>(await req.ReadAsStringAsync());
    process.Id = Guid.NewGuid().ToString("N");
    await client.SignalEntityAsync<IProcessor>(process.id, o => o.StartProcess(process));
}

Our telemetry shows that StartProcess for this id is sometimes triggered twice. Since the id is generated locally the trigger is not issuing the same message by being triggered twice. Since this occurs multiple times per day a Guid collision is extremely unlikely. We are seeing this for functions with HttpTriggers and QueueTriggers.

@nytian nytian added the P1 Priority 1 label May 7, 2024
@lilyjma lilyjma added Reliability Durable functions get stuck or don’t run as expected. and removed Needs: Triage 🔍 labels May 7, 2024
@alexjebens
Copy link
Author

The original Pseudocode used process.client instead of process.id

@sebastianburckhardt
Copy link
Member

I discovered recently that EventHubs can internally duplicate messages, which explains what you are seeing. See #379 for a discussion. Unfortunately we do not have any mechanism to deduplicate these duplicate deliveries. Your best bet is to implement some form of deduplication yourself.

@sebastianburckhardt sebastianburckhardt added wontfix This will not be worked on and removed P1 Priority 1 Reliability Durable functions get stuck or don’t run as expected. labels Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants