You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by " Kirill Sizov (Jira)" <ji...@apache.org> on 2024/05/31 09:39:00 UTC
[jira] [Assigned] (IGNITE-22335) Add assertion in async TxCleanupMessageResponse handler
[ https://issues.apache.org/jira/browse/IGNITE-22335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kirill Sizov reassigned IGNITE-22335:
--------------------------------------
Assignee: Kirill Sizov
> Add assertion in async TxCleanupMessageResponse handler
> -------------------------------------------------------
>
> Key: IGNITE-22335
> URL: https://issues.apache.org/jira/browse/IGNITE-22335
> Project: Ignite
> Issue Type: Bug
> Reporter: Vladislav Pyatkov
> Assignee: Kirill Sizov
> Priority: Major
> Labels: ignite-3
> Time Spent: 10m
> Remaining Estimate: 0h
>
> h3. Motivation
> This code seems like we might send TxCleanupMessageResponse with nullabe correlationId and result, but it is not really possible.
> {code:java}
> txMessageSender.messagingService().addMessageHandler(TxMessageGroup.class, (msg, sender, correlationId) -> {
> if (msg instanceof TxCleanupMessageResponse && correlationId == null) {
> CleanupReplicatedInfo result = ((TxCleanupMessageResponse) msg).result();
> if (result != null) {
> onCleanupReplicated(result);
> }
> if (msg instanceof TxCleanupMessageErrorResponse) {
> TxCleanupMessageErrorResponse response = (TxCleanupMessageErrorResponse) msg;
> LOG.warn("Exception happened during transaction cleanup [txId={}].", response.throwable(), response.txId());
> }
> }
> });
> {code}
> h3. Definition of done
> It just a possible siple improvment (but even better to change the responce inheratence structure, as the TxCleanupMessageErrorResponse does not inherit from TxCleanupMessageResponse):
> {code:java}
> txMessageSender.messagingService().addMessageHandler(TxMessageGroup.class, (msg, sender, correlationId) -> {
> if (msg instanceof TxCleanupMessageResponse && correlationId == null) {
> CleanupReplicatedInfo result = ((TxCleanupMessageResponse) msg).result();
> if (msg instanceof TxCleanupMessageErrorResponse) {
> TxCleanupMessageErrorResponse response = (TxCleanupMessageErrorResponse) msg;
> LOG.warn("Exception happened during transaction cleanup [txId={}].", response.throwable(), response.txId());
> }
> assert result != null : "Result for the cleanup response cannot be null.";
> onCleanupReplicated(result);
> }
> });
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)