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

Add optimistic concurrency to batch processing #220

Open
JackLewis-digirati opened this issue Jan 14, 2025 · 0 comments
Open

Add optimistic concurrency to batch processing #220

JackLewis-digirati opened this issue Jan 14, 2025 · 0 comments

Comments

@JackLewis-digirati
Copy link
Collaborator

JackLewis-digirati commented Jan 14, 2025

Requirement originated from code review comment related to "batch completed" notification processing to generate manifests: #214 (comment)

Original comment:

Are there any potential issues with this if we scaled up? E.g. if there was a Manifest that had 3 batches and we had scaled to 3 engines and 3 "complete" listeners. If each of those listeners received a "complete" notification at the same time for each of the 3 batches - is there a chance something could fall through, and the 3 batches are separately marked as 'complete' at the same time so the final "done" logic isn't fired?

I wonder if we could add a optimistic concurrency token to Batch to handle that? ie one of the 3 batches would fail and be requeued (not for this ticket, can revisit)

Ultimately the requirement is to prevent concurrent competing notification all marking separate batches as 'done' but no 1 single processor running the "batch completion" logic, meaning the Manifest wouldn't be generated.

An optimistic concurrency token was suggested as EF has native support for this: https://www.npgsql.org/efcore/modeling/concurrency.html?tabs=fluent-api and it would be a relatively rare occurrence.

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

1 participant