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

Marking event as completed fails silently #556

Open
maciejwalkowiak opened this issue Apr 18, 2024 · 3 comments
Open

Marking event as completed fails silently #556

maciejwalkowiak opened this issue Apr 18, 2024 · 3 comments
Assignees
Labels
in: event publication registry Event publication registry meta: waiting for feedback Waiting for feedback of the original reporter type: improvement Minor improvements

Comments

@maciejwalkowiak
Copy link
Contributor

When event serialization is misconfigured, it may happen that the serialized_event stored in the event_publication table will have slightly different value than the serialized event used in EventPublicationRepository#markCompleted. As a result, even though the event was processed successfully, it is never marked as processed.

This is a corner case, but since I've run into it, it may happen that others run into this issue too.

Here's the repository that reproduces the issue: https://github.com/maciejwalkowiak/modulith-mark-as-processed-issue

There are two classes to look at and I tried to explain what happens with comments:

Once you run the test, you'll see in logs where's the problem.

I believe EventPublicationRepository#markCompleted should throw an exception if no rows have been updated. This would make our serialization mistake obvious much sooner.

@odrotbohm odrotbohm self-assigned this Apr 18, 2024
@odrotbohm odrotbohm added this to the 1.2 RC1 milestone Apr 18, 2024
@odrotbohm odrotbohm added in: event publication registry Event publication registry type: improvement Minor improvements meta: waiting for feedback Waiting for feedback of the original reporter labels Apr 18, 2024
@odrotbohm
Copy link
Member

Do you think a EmptyResultDataAccessException would be appropriate, or shall we rather create a custom one?

@maciejwalkowiak
Copy link
Contributor Author

I can't think of any reason why it wouldn't be appropriate.

@odrotbohm odrotbohm removed this from the 1.2 RC1 milestone Apr 19, 2024
@odrotbohm
Copy link
Member

Testing a fix for this seems more elaborate than originally anticipated. Removing this from the RC1. I think we should be able to ship it in an upcoming bug fix release, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: event publication registry Event publication registry meta: waiting for feedback Waiting for feedback of the original reporter type: improvement Minor improvements
Projects
None yet
Development

No branches or pull requests

2 participants