Repository navigation
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1925.
The status transitions in
JpaEventPublicationRepository,JdbcEventPublicationRepositoryV2andNeo4jEventPublicationRepositorynow also require the completion date to be unset. This covers the statements behindmarkFailed(…),markProcessing(…)andmarkResubmitted(…), so a publication that completes after it has been looked up as failed or stale is neither claimed for resubmission nor flipped back toFAILED. As a side effect,markProcessing(…)no longer moves a completed publication back toPROCESSINGeither.The MongoDB repository already has this guard, along with tests for it from GH-1855 (
doesNotFailPublicationCompletedAfterStatusLookup()anddoesNotResubmitPublicationCompletedAfterFailedLookup()), 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()expectsmarkResubmitted(…)to returnfalsefor a completed publication.doesNotMarkCompletedPublicationFailed()expects noFAILEDpublication after callingmarkFailed(…)on a completed one.Without the change, both fail in the
UPDATEcompletion mode on all three stores. TheDELETEandARCHIVEmodes 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.