Skip to content

GH-1925 - Prevent completed event publications from being resubmitted or marked as failed - #1926

Open
char-yb wants to merge 1 commit into
spring-projects:mainfrom
char-yb:fix/gh-1925-completed-publication-transitions
Open

char-yb wants to merge 1 commit into
spring-projects:mainfrom
char-yb:fix/gh-1925-completed-publication-transitions

Conversation

@char-yb

@char-yb char-yb commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Closes #1925.

The status transitions in JpaEventPublicationRepository, JdbcEventPublicationRepositoryV2 and Neo4jEventPublicationRepository now also require the completion date to be unset. This covers the statements behind markFailed(…), markProcessing(…) and markResubmitted(…), so a publication that completes after it has been looked up as failed or stale is neither claimed for resubmission nor flipped back to FAILED. As a side effect, markProcessing(…) no longer moves a completed publication back to PROCESSING either.

The MongoDB repository already has this guard, along with tests for it from GH-1855 (doesNotFailPublicationCompletedAfterStatusLookup() and doesNotResubmitPublicationCompletedAfterFailedLookup()), so I left it untouched. The issue mentions adding a MongoDB regression test, but those tests already cover it.

The JPA, JDBC and Neo4j test suites each get two tests next to the GH-1565 ones:

  • doesNotResubmitCompletedPublication() expects markResubmitted(…) to return false for a completed publication.
  • doesNotMarkCompletedPublicationFailed() expects no FAILED publication after calling markFailed(…) on a completed one.

Without the change, both fail in the UPDATE completion mode on all three stores. The DELETE and ARCHIVE modes pass either way, as the completed publication is no longer in the table. With the change, the JPA and Neo4j suites pass, and the JDBC suite passes on H2, HSQLDB, MySQL, MariaDB, PostgreSQL, Oracle and SQL Server.

…ing resubmitted or marked as failed.

The status transitions in the JPA, JDBC and Neo4j event publication repositories only checked that a publication was not already in the target state. A publication that completed after having been looked up as failed or stale could thus still be claimed for resubmission or be flipped back to FAILED, causing the listener to be invoked again for an already processed event.

The statements used by markFailed(…), markProcessing(…) and markResubmitted(…) now also require the completion date to be unset, in line with the MongoDB repository.

Signed-off-by: char-yb <uiurihappy@naver.com>
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

Successfully merging this pull request may close these issues.

Completed event publications can be claimed for resubmission and marked as failed again

1 participant