mirromutth / r2dbc-mysql

R2DBC MySQL Implementation
Apache License 2.0
656 stars 98 forks source link

IllegalReferenceCountException exception in TextRowDecoder #221

Closed unoexperto closed 3 years ago

unoexperto commented 3 years ago

Hey folks,

I couldn't get to the bottom of this yet but I get IllegalReferenceCountException exception in TextRowDecoder.setPosition().

It happens in line

short type = this.buf.readUnsignedByte();

because reference count of RowDecoder.buf. I'm assuming you're reusing instance of ByteBuf. So far I can't find consistent pattern to reproduce it but I can say it happens when query returns a lot of rows (80K+ items).

UPD: Sadly I'm seeing that it sometimes it doesn't happen even with large batch when I'm in the debugger. Race condition somewhere?