Skip to content

Commit 14ce365

Browse files
committed
Some slight fix for KafkaRecoverableProducer
1 parent 5fa8bc0 commit 14ce365

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/kafka/addons/KafkaRecoverableProducer.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ class KafkaRecoverableProducer
5252
*/
5353
const std::string& name() const
5454
{
55-
// lock
55+
std::lock_guard<std::mutex> lock(_producerMutex);
56+
5657
return _producer->name();
5758
}
5859

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

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

0 commit comments

Comments
 (0)