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

Clean up mailbox messages for closed trades #4746

Conversation

chimp1984
Copy link
Contributor

We got growing pending mailbox messages since 1.4.2. (about 2000 now, normal is about 500). With the trade protocol refactoring a cleanup for mailbox messages has been missed.

Steps to reproduce issue:
Start a trade and let peer go offline. When Seller confirms receipt he sends a msg to buyer, as he is offline its a mailbox msg. Seller moves funds to his wallet and his trade is closed. Buyer goes online and closes his trade as well. He sends back a AckMessage that he received the trade message but as sellers trade is closed that ackMsg is not being processed (done in tradeProtocol class which is not initialized for closed trades).

Solution:
We iterate closed and failed trades and look up if there are some pending mailbox messages and if we find any we remove them from the network.
It can be that there are failure scenarios where mailbox messages did not got removed as well. This should fix those cases as well.

Util for removing pending mailbox messages in case the
trade has been closed by the seller after confirming receipt
and a AckMessage as mailbox message will be sent by the
buyer once they go online. In that case the seller's trade
is closed already and the TradeProtocol is not executing
the message processing, thus the mailbox message would not
be removed. To ensure that in such cases (as well other
potential cases in failure scenarios) the mailbox message
gets removed from the network we use that util.
Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@sqrrm sqrrm merged commit 83ee1fe into bisq-network:master Nov 4, 2020
@chimp1984 chimp1984 deleted the cleanup-mailbox-messages-at-closed-trades branch November 4, 2020 15:48
@ripcurlx ripcurlx added this to the v1.5.0 milestone Nov 9, 2020
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.

3 participants