Skip to content

Commit

Permalink
Fix non-linearizability in BufferedChannel.expandBuffer() (#3730)
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Koval <ndkoval@ya.ru>
  • Loading branch information
ndkoval committed May 5, 2023
1 parent a027d68 commit 6165533
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1220,9 +1220,9 @@ internal open class BufferedChannel<E>(
incCompletedExpandBufferAttempts()
return
}
// Is `bufferEndSegment` outdated?
// Is `bufferEndSegment` outdated or is the segment with the required id already removed?
// Find the required segment, creating new ones if needed.
if (segment.id < id) {
if (segment.id != id) {
segment = findSegmentBufferEnd(id, segment, b)
// Restart if the required segment is removed, or
// the linked list of segments is already closed,
Expand Down

0 comments on commit 6165533

Please sign in to comment.