You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/03/16 05:01:37 UTC

[GitHub] [pulsar] michaeljmarshall commented on pull request #14185: [Java Client] Optimize batch flush scheduling

michaeljmarshall commented on pull request #14185:
URL: https://github.com/apache/pulsar/pull/14185#issuecomment-1068734602


   @lhotari and @merlimat - I realized that the cost of canceling and rescheduling a batch message timer for every batch might not be ideal, especially in high throughput producers. Therefore, I switched the logic to match that of the `sendTimeout`, which essentially reschedules a timeout if an insufficient amount of time has passed since an event (in this PR's case, that is the time since last sending a message).
   
   I also rand into an issue with the `SimpleProducerConsumerStatTest#testSendTimeout`. It exposed the fact that my design did not allow for queued batch messages to get timed out when the producer is disconnected. I updated the logic with a naive solution. The one "surprising" affect of my solution might be that a message might get up to double the send timeout if the producer reconnects at the "right" time. I think this is fine, but let me know if this tradeoff is a problem.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org