merlimat opened a new pull request, #25986:
URL: https://github.com/apache/pulsar/pull/25986

   ### Motivation
   
   `ServerCnx#printSendCommandDebug` is called unconditionally from 
`handleSend` and parses the full `MessageMetadata` of every published message — 
plus eagerly materializing the `producerName`/`partitionKey` strings and an 
`orderingKey` `byte[]` copy — before the `log.debug()` event is ever consulted. 
The cost is paid on the Netty IO thread for every produce command, at any log 
level. The `isDebugEnabled()` guard around this block was lost in the 
structured-logging migration.
   
   ### Modifications
   
   Wrap the method body in the lazy `log.debug(Consumer<Event>)` form, which 
checks whether debug logging is enabled before invoking the lambda, so the 
metadata parse and attribute evaluation no longer run on the hot path when 
debug logging is disabled.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to