-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-17196. Overflow during getDatanodeReadTimeout #6091
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
Conversation
|
💔 -1 overall
This message was automatically generated. |
| int getDatanodeReadTimeout(int numNodes) { | ||
| final int t = dfsClientConf.getSocketTimeout(); | ||
| return t > 0? HdfsConstants.READ_TIMEOUT_EXTENSION*numNodes + t: 0; | ||
| int readTimeout = HdfsConstants.READ_TIMEOUT_EXTENSION*numNodes + t; | ||
| Preconditions.checkArgument(readTimeout >= 0, | ||
| "Read timeout should be non-negative."); | ||
| return t > 0? readTimeout: 0; |
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.
should be something like?
int getDatanodeReadTimeout(int numNodes) {
final int t = dfsClientConf.getSocketTimeout();
if (t > 0) {
int readTimeout = HdfsConstants.READ_TIMEOUT_EXTENSION * numNodes + t;
Preconditions.checkArgument(readTimeout >= 0, "Read timeout should be non-negative.");
return readTimeout;
}
return 0;
}
|
💔 -1 overall
This message was automatically generated. |
|
@teamconfx any plans to update? |
|
We're closing this stale PR because it has been open for 100 days with no activity. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
Description of PR
Datanode read timeout equals to READ_TIMEOUT_EXTENSION * numNodes +
dfs.client.socket-timeout. A large dfs.client.socket-timeout/numNodes/READ_TIMEOUT_EXTENSION will cause overflow.To reproduce:
dfs.client.socket-timeoutto 2147483646mvn surefire:test -Dtest=org.apache.hadoop.hdfs.server.namenode.ha.TestHASafeMode#testBlocksRemovedWhileInSafeModeEditsArriveFirstThis PR provides a fix by checking the read timeout calculation is at least 0.
How was this patch tested?
Unit test
For code changes: