-
Notifications
You must be signed in to change notification settings - Fork 67
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
bugfix: check callback to avoid std::bad_function_call exception #456
base: main
Are you sure you want to change the base?
Conversation
hi, @zliang-min Thanks for PR, can you add a unit test to cover this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the code style check. See https://github.com/apache/pulsar-client-cpp?tab=readme-ov-file#requirements-for-contributors for how to use clang-format 11 to format the code
int res = makePutRequest(url, "5"); | ||
LOG_INFO("res = " << res); | ||
ASSERT_FALSE(res != 204 && res != 409); | ||
} | ||
} | ||
|
||
protected: | ||
bool isMultiTopic_ = GetParam(); | ||
std::string fullTopicName(const std::string & topicName) { | ||
return (isNonPersistentTopic ? "non-" : "") + "persistent://public/default/" + topicName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return (isNonPersistentTopic ? "non-" : "") + "persistent://public/default/" + topicName; | |
return std::string(isNonPersistentTopic ? "non-" : "") + "persistent://public/default/" + topicName; |
Only std::string
can be used to call operator+
. Otherwise the build will fail with "Invalid operands to binary expression ('const char *' and 'const char[29]') "
int res = makePutRequest(url, "5"); | ||
LOG_INFO("res = " << res); | ||
ASSERT_FALSE(res != 204 && res != 409); | ||
} | ||
} | ||
|
||
protected: | ||
bool isMultiTopic_ = GetParam(); | ||
std::string fullTopicName(const std::string & topicName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testPartitionIndex
uses TEST
but not TEST_F
or TEST_P
. If you're going to call this method in those tests, please change TEST
to TEST_P
I will start the release for 3.7.0 soon. Any chance to address the comments? If not, I can open another PR to fix it. |
Hi @BewareMyPower sorry for the late response. I have been busy with some other work recently. You are more than welcome to open another PR for this. Or it will take a little while before I can get back to this. Thanks! |
Fixes #455
Motivation
Fixed the bug that when reading messages from a non-persistent topic with
Reader
, it throwstd::bad_function_call
exception.Modifications
Check
checkback
before calling it inAckGroupingTracker
.Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
Documentation
doc-required
(Your PR needs to update docs and you will update later)
doc-not-needed
(Please explain why)
A simple bug fix.
doc
(Your PR contains doc changes)
doc-complete
(Docs have been already added)