Repository navigation
ReadyOnly*Buf must return false for isWritable(*) when sliced or duplicated - #14071
Conversation
|
@normanmaurer I'm a bit lost on how to add a unit test for this one. Would you mind giving a hint which class or method I should look for examples of similar tests? |
|
The workaround I'm currently testing for Pulsar is to use |
|
There are more obstacles on the way to support readonly buffers in SslHandler. When I tested the workaround of using |
|
In the Pulsar PR, I'm currently using this type of workaround: https://github.com/apache/pulsar/pull/22760/files . Currently running CI to see if tests pass with it. I ran some manual tests were I have been able to reproduce the race conditions and those pass. |
…icated Motivation: We need to ensure we return the correct type when duplicate() or slice(*) is called as otherwise we might return true when isWritable(...) is called Modifications: - Return correct type - Add test-cases Result: Related to netty#14069
|
@lhotari actually the problem was not in the queue implementation but the buffers itself. I just pushed an extra commit to your branch which fixes it |
| private static boolean attemptCopyToCumulation(ByteBuf cumulation, ByteBuf next, int wrapDataSize) { | ||
| final int inReadableBytes = next.readableBytes(); | ||
| // Nothing to copy so just release the buffer. | ||
| if (inReadableBytes == 0) { |
There was a problem hiding this comment.
I still kept this one, even tho its not needed to fix the problem
Awesome! Thank you @normanmaurer |
…icated (#14071) Motivation: We need to ensure we return the correct type when duplicate() or slice(*) is called as otherwise we might return true when isWritable(...) is called Modifications: - Return correct type - Add test-cases Result: Related to #14069 --------- Co-authored-by: Norman Maurer <[email protected]>
Motivation:
We need to ensure we return the correct type when duplicate() or slice(*) is called as otherwise we might return true when isWritable(...) is called
Modifications:
Result:
Related to #14069