-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Partitioned consumer test failure #323
Conversation
boost::bind(resendMessage, _1, _2, producer)); | ||
} | ||
} else { | ||
producer.sendAsync(MessageBuilder().setProperty("attempt#", boost::lexical_cast<std::string>(attemptNumber + 1)).build(), | ||
boost::bind(resendMessage, _1, _2, producer)); |
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.
can't we just write
if (attemptNumber < 3) {
globalResendMessageCount++;
lock.unlock();
}
producer.sendAsync(MessageBuilder().setProperty("attempt#", boost::lexical_cast<std::string>(attemptNumber + 1)).build(),
boost::bind(resendMessage, _1, _2, producer));
@@ -815,6 +826,6 @@ TEST(BasicEndToEndTest, testMessageListenerPause) | |||
|
|||
// 3 seconds | |||
usleep(3 * 1000 * 1000); | |||
|
|||
Lock lock(mutex_); |
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.
What was the failure without the lock?
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.
There are two threads using the variable - hence W/O the lock the behavior is undefined.
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.
👍
…#323) ### Motivation enable users to configure the logger used by the client and use their own implementation. If no logger is provided, a wrapped `logrus.StandardLogger()` will be used. <s>This PR only solved part of the problem mentioned in the issue https://github.com/apache/pulsar-client-go/issues/228.</s> ### Modifications * define `Logger` and `Entry` interfaces used by the client * add `Logger` field to ClientOptions * add `logger` field to internal structures * provide a logger implementation backed by logrus * implement a no-op logger
Motivation
Reduce the number of intermittent test failures before we start work on #238
Modifications
Result