java-dogstatsd-client icon indicating copy to clipboard operation
java-dogstatsd-client copied to clipboard

Clear buffers before returning them to the pool

Open vickenty opened this issue 3 years ago • 0 comments

After an unsuccessful write, StatsDSender would not clear the buffer before returning it to the pool. This could cause the processor to get the buffer with lim<cap, possibly failing to write to the buffer and incorrectly submitting it to the sender again with pos=0 (which results in a no-op write, because after .flip() buffer would have pos=0,lim=0).

Fixes #198

vickenty avatar Aug 04 '22 12:08 vickenty