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

The retry will happen even when the event was delivered successfully. #81

Open
foolisheep opened this issue Oct 8, 2024 · 1 comment

Comments

@foolisheep
Copy link

This is unexpected. Can we only send the event when the delivery was failed?

@tonesandtones
Copy link

I've just hit this problem too. When used with Azure Functions, the az func core tools runtime responds with 202 Accepted instead of 200 OK. Returning anything other than 200 OK causes the emulator to retry the message even though it doesn't need to.

image

This comes from SubscriberConstants.NonRetriableStatusCodes

public static readonly HashSet<HttpStatusCode> NonRetriableStatusCodes = new HashSet<HttpStatusCode>
{
// Of course we let HTTP 200 pass through
HttpStatusCode.OK,
// Those cannot be retried based on Event Grid's documentation
// https://learn.microsoft.com/en-us/azure/event-grid/delivery-and-retry#retry-schedule
HttpStatusCode.BadRequest,
HttpStatusCode.RequestEntityTooLarge,
HttpStatusCode.Unauthorized,
};

I know https://github.com/gsoft-inc/wl-eventgrid-emulator/blob/main/CONTRIBUTING.md says you don't accept external PRs, but I've forked and fixed the problem for my own use at https://github.com/tonesandtones/wl-eventgrid-emulator/tree/81-prevent-retry-on-2xx-status. I'm happy to put up a PR if you're interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants