Repository navigation
v0.8.2
Netty leak-aware composite buffers parse correctly again
v0.8.0's unchecked 64-bit varint reader (#14) reads Netty's AbstractByteBuf.readerIndex field directly instead of going through the accessors. Netty's leak-aware composite buffers (SimpleLeakAwareCompositeByteBuf, AdvancedLeakAwareCompositeByteBuf) extend AbstractByteBuf but delegate their reader index to the wrapped composite, so their own field is never the real position: on those buffers the reader decoded from the wrong offset and its advance never reached the wrapped buffer. Valid messages parsed to wrong values or failed with IndexOutOfBoundsException: Truncated protobuf message. Any composite buffer allocated with leak detection at PARANOID, or at SIMPLE/ADVANCED when the allocation was sampled, was affected, in production as well as in tests; direct, heap, sliced and duplicated buffers were not. Surfaced by Apache Pulsar's CI on restoring paranoid leak detection for its Gradle tests (apache/pulsar#26605). Reported and fixed by @lhotari (#21, #22).
Fix varint64 reads for leak-aware composite buffers (#22)
The generated codec resolves Netty's package-private WrappedCompositeByteBuf once by name and routes that hierarchy through the existing checked reader; every other AbstractByteBuf keeps the unchecked path, and if the class cannot be resolved the codec falls back to checked reads throughout. Seven regression cases parse 1- to 10-byte varints, including negative values, from a paranoid-leak-detection composite at a non-zero reader index; all of them failed before the fix.