You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The processIncompletePublications method includes a retry mechanism for failed events and leverages the inProgress cache to improve efficiency. However, there is an issue:
1.In the finally block, the inProgress.unregister(it) method is redundantly called.
2.This leads to unnecessary cache invalidation because consuming events might be an asynchronous operation that has not been completed.
3.Both the markFailed and markCompleted methods already handle the inProgress.unregister operation, making the finally block unnecessary.
Suggested Fix:
Remove the finally block containing inProgress.unregister(it) to avoid redundant operations and improve code clarity.
The explicit unregister was introduced for GH-891. Primarily to guard against target listeners not being advised to trigger markFailed(…)/markCompleted(…) imposing the theoretical risk of a publication staying in progress indefinitely. Revisiting that situation, it's clear that we might want to find alternative means to guard against that and rather reject the case rather than trying to adapt to it.
odrotbohm
changed the title
Remove Redundant inProgress.unregister in DefaultEventPublicationRegistry.processIncompletePublications
Resubmission of publications must not unregister in-progress publications in case of successful invocation
Feb 23, 2025
…rors.
Before this commit the code resubmitting incomplete event publications unregistered them independently of whether they succeeded or not. We now only do that for failed submissions as an error here indicates a failure to *submit* the publication. As the execution is likely performed asynchronously, a successful hand-off does not implicate the publication being completely processed.
Uh oh!
There was an error while loading. Please reload this page.
The processIncompletePublications method includes a retry mechanism for failed events and leverages the inProgress cache to improve efficiency. However, there is an issue:
1.In the finally block, the inProgress.unregister(it) method is redundantly called.
2.This leads to unnecessary cache invalidation because consuming events might be an asynchronous operation that has not been completed.
3.Both the markFailed and markCompleted methods already handle the inProgress.unregister operation, making the finally block unnecessary.
Suggested Fix:
Remove the finally block containing inProgress.unregister(it) to avoid redundant operations and improve code clarity.
Code Example of Current Implementation:
Proposed Fix:
The text was updated successfully, but these errors were encountered: