Skip to content

Use duplicates when writing from ByteBuf pair to avoid multiple threads issues - #1203

Merged
merlimat merged 1 commit into
apache:masterfrom
merlimat:fix-producer-corruption
Feb 8, 2018
Merged

merlimat merged 1 commit into
apache:masterfrom
merlimat:fix-producer-corruption

Conversation

@merlimat

@merlimat merlimat commented Feb 8, 2018

Copy link
Copy Markdown
Contributor

Motivation

This is a fix for #1201.

The truncation happens when, during an unload, the topic moves from one broker to another. If the write operation on the previous connection was still ongoing, it can cause issues when the new IO (associated with the "new" connection) will start writing on the new socket.

Modifications

Take a duplicate of theByteBuf so that each thread will have its own readerIndex on the buffer.

@merlimat merlimat added the type/bug The PR fixed a bug or issue reported a bug label Feb 8, 2018
@merlimat merlimat added this to the 1.22.0-incubating milestone Feb 8, 2018
@merlimat merlimat self-assigned this Feb 8, 2018
@merlimat

merlimat commented Feb 8, 2018

Copy link
Copy Markdown
Contributor Author

@jai1 @rdhabalia PTAL at this one

@rdhabalia rdhabalia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘

@merlimat
merlimat merged commit feb0acc into apache:master Feb 8, 2018
@merlimat
merlimat deleted the fix-producer-corruption branch February 8, 2018 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants