Skip to content

Conversation

@devinbost
Copy link
Contributor

@devinbost devinbost commented Apr 28, 2021

I noticed that we're performing a compareAndSet type of operation in readMoreEntries() in the persistent dispatchers on the field havePendingRead, but the way we're doing it isn't thread-safe since readMoreEntries() isn't synchronized.
As @rdhabalia mentioned in #9789 that there are no pending reads despite backlog and available permits, it seems like there may be a concurrency issue with the pending read status.

I need someone with more experience with concurrency primitives in Java to review this PR to indicate if it actually improves anything because I only found one place where there was a clear "compareAndSet" type of operation, so I don't see clearly competing accesses, and it's not clear to me if access on this field occurs from multiple threads in this location.

@devinbost
Copy link
Contributor Author

@merlimat ?

@devinbost
Copy link
Contributor Author

@lhotari Is this still needed now that #10413 has been merged?

@merlimat
Copy link
Contributor

I think adding the sync block was the correct fix and should already be enough.

@devinbost devinbost closed this Apr 28, 2021
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 this pull request may close these issues.

2 participants