Skip to content

Commit

Permalink
Some slight fix for KafkaRecoverableProducer
Browse files Browse the repository at this point in the history
  • Loading branch information
kenneth-jia committed Oct 20, 2021
1 parent 5fa8bc0 commit 14ce365
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/kafka/addons/KafkaRecoverableProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class KafkaRecoverableProducer
*/
const std::string& name() const
{
// lock
std::lock_guard<std::mutex> lock(_producerMutex);

return _producer->name();
}

Expand Down Expand Up @@ -312,7 +313,8 @@ class KafkaRecoverableProducer
_producer->pollEvents(std::chrono::milliseconds(1));
if (_fatalError)
{
KAFKA_API_LOG(Log::Level::Notice, "met fatal error[%s], would re-initialze the internal producer");
const std::string errStr = _fatalError->toString();
KAFKA_API_LOG(Log::Level::Notice, "met fatal error[%s], will re-initialize the internal producer", errStr.c_str());

std::lock_guard<std::mutex> lock(_producerMutex);

Expand Down

0 comments on commit 14ce365

Please sign in to comment.