Skip to content

Conversation

hairyhum
Copy link
Contributor

@hairyhum hairyhum commented Oct 1, 2018

Before bf531fd rejects were not
collected like confirms and extracted from unconfirmed.

When adding the feature the important detail was missed:
if unconfirmed dtree is empty, confirms will be sent as multiple
confirming all messages up to latest.

If there are rejects recorded, the channel can send multiple confirm
and then reject right after with a lower message ID, which makes clients
fail.

Reported in php-amqplib/php-amqplib#597

TODO:

Come up with a reliable test for this scenario. Meddling with the stats timer may be required.

Before bf531fd rejects were not
collected like confirms and extracted from unconfirmed.

When adding the feature the important detail was missed:
if unconfirmed dtree is empty, confirms will be sent as multiple
confirming all messages up to latest.

If there are rejects recorded, the channel can send multiple confirm
and then reject right after with a lower message ID, which makes clients
fail.

Reported in php-amqplib/php-amqplib#597
@hairyhum hairyhum requested a review from lukebakken October 1, 2018 16:45
@lukebakken
Copy link
Collaborator

Thanks @hairyhum! I will review this today.

@lukebakken
Copy link
Collaborator

I'm having trouble reproducing the issue that @csernazs reports in php-amqplib/php-amqplib#597. However, that user can reproduce this issue and reports that these changes did not fix it. I'm going to continue investigating today.

The cutoff value should be a number, corresponding to the minimal
uncommitted or rejected message (or confirmed if sending rejects).
erlang:min compares term values and will not traverse a list of
NegativeMsgSeqNos.
@hairyhum
Copy link
Contributor Author

hairyhum commented Oct 2, 2018

There was a typo-like error. Instead of finding the smallest value in the list with additional value, it was comparing the list with that value. Oops.

@lukebakken
Copy link
Collaborator

@csernazs reports that this PR fixes php-amqplib/php-amqplib#597. I'll do a review today but I think we're good. Nice job @hairyhum

Copy link
Collaborator

@lukebakken lukebakken left a comment

Choose a reason for hiding this comment

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

Should the TODO items be addressed or is that for future work? If it's for the future, can we ensure it's not missed?

@hairyhum
Copy link
Contributor Author

hairyhum commented Oct 3, 2018

TODO left in the code is not new. I still would like to create a test to reproduce the error though.

Copy link
Collaborator

@lukebakken lukebakken left a comment

Choose a reason for hiding this comment

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

👍 feel free to add a test to this PR or do another.

@michaelklishin
Copy link
Collaborator

We concluded that an "external" (issue-specific) test would be nice but since it's highly time-sensitive and requires a lot of iterations [to prove an absence of the problem] it should not be included into the integration suite. Perhaps property-based testing of key functions would be optimal. Let's merge this.

@michaelklishin michaelklishin merged commit 631f101 into master Oct 3, 2018
@michaelklishin michaelklishin deleted the rejects-confirms-interdependency branch October 3, 2018 16:38
@hairyhum
Copy link
Contributor Author

hairyhum commented Oct 4, 2018

Added test in 3ae27d2

@hairyhum hairyhum mentioned this pull request Oct 17, 2018
@lukebakken lukebakken added this to the 3.7.15 milestone Apr 29, 2019
lukebakken pushed a commit that referenced this pull request Apr 29, 2019
Take reject into account when sending confirms and vice-versa.

(cherry picked from commit 631f101)
@lukebakken
Copy link
Collaborator

Backported to v3.7.x

lukebakken pushed a commit that referenced this pull request Apr 29, 2019
Take reject into account when sending confirms and vice-versa.

(cherry picked from commit 631f101)
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