guyinyou commented on issue #6518:
URL: https://github.com/apache/rocketmq/issues/6518#issuecomment-1491500452
It can be easily reproduced by the following demo
```
ByteBuffer buffer = ByteBuffer.allocateDirect(1000000);
buffer.position(1000000);
buffer.flip();
new Thread(()->{
while (buffer.hasRemaining()){
int pos = buffer.position();
buffer.mark();
buffer.get();
buffer.reset();
buffer.position(pos + 4);
}
System.out.println("over");
System.exit(0);
}).start();
new Thread(()->{
while (true){
ByteBuffer tmp = buffer.duplicate();
if(tmp.position() == 0){
System.out.println(tmp);
}
}
}).start();
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]