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
Fix typo in KQueueChannelConfig #12537
Conversation
Buffer allocation should be based on the length of the option, not on its level. This fixes a test failure (KQueueChannelConfigTest.testRawOption) on MacOS.
@thobe can you sign our icla please: https://netty.io/s/icla . Thanks! |
@normanmaurer sure, I'll need to pass it through the chain of my employer first, since the netty project isn't already on our list of open source projects (it would be good to get on the list though, so that's a sensible thing to do anyhow). I was hoping this particular fix would qualify under "unless your contribution is trivial such as a single line change or a typo fix." mentioned in the developer guide to be able to get it done a little bit quicker. |
If @tjake has contributed before, then I'm surprised the netty project isn't on our list, that might just be an internal bookkeeping mishap. I'll get it sorted out. |
@thobe thanks for the contribution! |
No porting to |
Motivation: KQueueChannelConfigTest.testRawOption() fails on MacOS due to the buffer for the RawUnixChannelOption being over-allocated when retrieving the option value. Since the limit is not explicitly set (the buffer is just flipped), the limit of the buffer will be based on its size, causing the test to fail. Modification: Changes the buffer allocation for getOption of RawUnixChannelOption in KQueueChannelConfig to be based on the length of the option instead of the level. The use of level is likely a typo. The corresponding code in EpollChannelConfig allocates the buffer based on length rather than level. Result: One less test failure when building on MacOS (Intel) with JDK 1.8.
Motivation: KQueueChannelConfigTest.testRawOption() fails on MacOS due to the buffer for the RawUnixChannelOption being over-allocated when retrieving the option value. Since the limit is not explicitly set (the buffer is just flipped), the limit of the buffer will be based on its size, causing the test to fail. Modification: Changes the buffer allocation for getOption of RawUnixChannelOption in KQueueChannelConfig to be based on the length of the option instead of the level. The use of level is likely a typo. The corresponding code in EpollChannelConfig allocates the buffer based on length rather than level. Result: One less test failure when building on MacOS (Intel) with JDK 1.8.
Motivation:
KQueueChannelConfigTest.testRawOption() fails on MacOS due to the buffer for the RawUnixChannelOption being over-allocated when retrieving the option value. Since the limit is not explicitly set (the buffer is just flipped), the limit of the buffer will be based on its size, causing the test to fail.
Modification:
Changes the buffer allocation for getOption of RawUnixChannelOption in KQueueChannelConfig to be based on the length of the option instead of the level. The use of level is likely a typo. The corresponding code in EpollChannelConfig allocates the buffer based on length rather than level.
Result:
One less test failure when building on MacOS (Intel) with JDK 1.8.