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

Add close method in the class of NegativeAcksTracker #12469

Merged
merged 6 commits into from
Oct 31, 2021

Conversation

lordcheng10
Copy link
Contributor

Add close method in the class of NegativeAcksTracker

@eolivelli
Copy link
Contributor

@lordcheng10:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@lordcheng10 lordcheng10 changed the title Add nack close method Add close method in the class of NegativeAcksTracker Oct 23, 2021
@lordcheng10
Copy link
Contributor Author

@lordcheng10:Thanks for your contribution. For this PR, do we need to update docs? (The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

No need to add documentation

@codelipenghui codelipenghui added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Oct 24, 2021
@codelipenghui codelipenghui added this to the 2.10.0 milestone Oct 24, 2021
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

awesome work!

please add tests as @codelipenghui suggested

@lordcheng10
Copy link
Contributor Author

ConsumerImplTest.testClose method has been added. Please review again,thanks! @codelipenghui

Comment on lines 193 to 201
Exception checkException = null;
try {
if (consumer != null) {
consumer.close();
}
} catch (Exception e) {
checkException = e;
}
Assert.assertNull(checkException);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please confirm the timeout==null and the displayedMessages== null in the Tracker

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By default timeout is null and the nackedMessages is null. By calling consumer.negativeAcknowledge(new MessageIdImpl(-1, -1, -1)) to make timeout != null and nackedMessages != null .

Please review again,thanks! @315157973

Copy link
Contributor

Choose a reason for hiding this comment

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

Then why not close Consumer after calling consumer.negativeAcknowledge?

Your unit test has no way to confirm that the Tracker is closed, and we can't even confirm that the close method has been called.

Copy link
Contributor Author

@lordcheng10 lordcheng10 Oct 26, 2021

Choose a reason for hiding this comment

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

you are right! I resubmitted the modification: close Consumer after calling consumer.negativeAcknowledge:

public void testClose() {
Exception checkException = null;
try {
if (consumer != null) {
consumer.negativeAcknowledge(new MessageIdImpl(-1, -1, -1));
consumer.close();
}
} catch (Exception e) {
checkException = e;
}
Assert.assertNull(checkException);
}

Please review again,thanks! @315157973

…egativeAcksTracker.

By default timeout is null and the nackedMessages is null.
@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

4 similar comments
@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

2 similar comments
@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

1 similar comment
@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

3 similar comments
@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

@codelipenghui PTAL,thanks!

@eolivelli eolivelli merged commit 3694aa1 into apache:master Oct 31, 2021
@eolivelli
Copy link
Contributor

@codelipenghui 's comment has been addressed.

Merged to master branch

hangc0276 pushed a commit that referenced this pull request Nov 4, 2021
@hangc0276 hangc0276 added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Nov 4, 2021
eolivelli pushed a commit that referenced this pull request Nov 9, 2021
@eolivelli eolivelli modified the milestones: 2.10.0, 2.9.0 Nov 9, 2021
eolivelli pushed a commit to eolivelli/pulsar that referenced this pull request Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-2.8 Archived: 2.8 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants