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 DefaultChannelId#asLongText
NPE
#13971
Conversation
6b2e2e7
to
c40a4aa
Compare
public void testDeserialization() throws Exception { | ||
// deseiralize DefaultChannelId with 8 byte machineId | ||
final ObjectInputStream in8 = new ObjectInputStream(new ByteArrayInputStream(EIGHT_BYTES_MACHINE_ID)); | ||
final DefaultChannelId c8 = (DefaultChannelId) in8.readObject(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to see a @VisibleForTesting
package-private constructor where you can pass in either the values or a finished byte array. Keeping the binaries around is troublesome for maintenance and debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, Let me implement it :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Could you please take a look?
1b966c3
to
9c3590f
Compare
final int machineIdLen = len - nonMachineIdLen; | ||
final int otherMachineIdLen = otherLen - nonMachineIdLen; | ||
final int minMachineIdLen = Math.min(machineIdLen, otherMachineIdLen); | ||
assert machineIdLen != otherMachineIdLen; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is over-thinking it. As long as the sort order is consistent, it should be fine. No need to make it match the long-text sorting, IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Let me fix it
b2361c0
to
9d8d2ae
Compare
Motivation: The DefaultChannelId class is serializable, but it does not account for variations in the length of machineId. Modifications: Adjusted code to accommodate varying lengths of MachineId. Result: Fixed NPE. Respects varying length of machineId.
4c03f4f
to
0d36515
Compare
I've just changed to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
@jchrys please also port to main
Sure! I will check |
### What changes were proposed in this pull request? The pr aims to upgrade `netty` from `4.1.108.Final` to `4.1.109.Final`. ### Why are the changes needed? https://netty.io/news/2024/04/15/4-1-109-Final.html This version has brought some bug fixes and improvements, such as: - Fix DefaultChannelId#asLongText NPE ([#13971](netty/netty#13971)) - Rewrite ZstdDecoder to remove the need of allocate a huge byte[] internally ([#13928](netty/netty#13928)) - Don't send a RST frame when closing the stream in a write future while processing inbound frames ([#13973](netty/netty#13973)) ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #46112 from panbingkun/netty_for_spark4. Authored-by: panbingkun <panbingkun@baidu.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
### What changes were proposed in this pull request? Bump Netty from 4.1.107.Final to 4.1.109.Final. ### Why are the changes needed? Netty has released v4.1.108.Final, v4.1.109.Final, which release note refers to [4.1.108.Final](https://netty.io/news/2024/03/21/4-1-108-Final.html), [4.1.109.Final](https://netty.io/news/2024/04/15/4-1-109-Final.html). This version includes some bugfixes and improvements including: - 4.1.108.Final - Epoll: Correctly handle splice tasks when Channel is closed: netty/netty#13848 - 4.1.109.Final - Don't send a RST frame when closing the stream in a write future while processing inbound frames: netty/netty#13973 - Fix DefaultChannelId#asLongText NPE: netty/netty#13971 - Rewrite ZstdDecoder to remove the need of allocate a huge byte[] internally: netty/netty#13928 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? No. Closes #2474 from SteNicholas/CELEBORN-1396. Authored-by: SteNicholas <programgeek@163.com> Signed-off-by: mingji <fengmingxiao.fmx@alibaba-inc.com>
Motivation:
The DefaultChannelId class is serializable, but it does not account for variations in the length of machineId.
Modifications:
Adjusted code to accommodate varying lengths of MachineId.
Result:
Fixed NPE.
Respects varying length of machineId.