Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shrared buffer issues due to readerIndex #831

Closed
hylkevds opened this issue Apr 28, 2024 · 0 comments · Fixed by #832
Closed

Shrared buffer issues due to readerIndex #831

hylkevds opened this issue Apr 28, 2024 · 0 comments · Fixed by #832

Comments

@hylkevds
Copy link
Collaborator

ByteBufs are shared between many sessions and threads. Because if this it is important that none of these session change the readerIndex of the shared buffer, and when changing the readerIndex can not be avoided, a duplicate() must be made.

In most cases this can be fixed by using the .getX() methods instead of the .readX() versions.

A PR is on its way.

andsel pushed a commit that referenced this issue Apr 30, 2024
…ged (#832)

DebugUtils.payload2Str set the readerIndex to the readableBytes, witch
was simply wrong. Utils.readBytesAndRewind was unused and thus removed.
SegmentedPersistentQueueSerDes use of readBytes (that changes the
readerIndex) was changed to getBytes which does not change the readerIndex.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant