-
Notifications
You must be signed in to change notification settings - Fork 124
Closed
Description
Netty 4.1.30 and above (plus earlier versions intermittently) fail the following test:
[INFO] Running org.lmdbjava.CursorParamTest
[ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.78 s <<< FAILURE! - in org.lmdbjava.CursorParamTest
[ERROR] execute[4: buffer adapter: org.lmdbjava.CursorParamTest$NettyBufferRunner@68b7bdcb](org.lmdbjava.CursorParamTest) Time elapsed: 0.015 s <<< ERROR!
java.lang.IndexOutOfBoundsException: readerIndex: 0, writerIndex: 8 (expected: 0 <= readerIndex <= writerIndex <= capacity(4))
at io.netty.buffer.AbstractByteBuf.checkIndexBounds(AbstractByteBuf.java:112)
at io.netty.buffer.AbstractByteBuf.readerIndex(AbstractByteBuf.java:121)
at org.lmdbjava.ByteBufProxy.out(ByteBufProxy.java:144)
at org.lmdbjava.ByteBufProxy.out(ByteBufProxy.java:39)
at org.lmdbjava.KeyVal.valOut(KeyVal.java:133)
at org.lmdbjava.Cursor.get(Cursor.java:153)
at org.lmdbjava.CursorParamTest$AbstractBufferRunner.execute(CursorParamTest.java:127)
at org.lmdbjava.CursorParamTest.execute(CursorParamTest.java:90)Two issues were identified in ButeBufProxy:
- The unsafe setting of the
LENGTH_OFFSETwas setting the value as along, whereas the actual field in the JavaPooledByteBuftype is anint. - The order of updating the
readerIndexbefore thewriterIndexwas causing the bounds check on thereaderIndexcall to fail as thewriterIndexhad not yet been corrected.
Correction of the above causes tests to pass consistently with Netty 4.1.32 (currently the latest version).
Metadata
Metadata
Assignees
Labels
No labels