-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-18324. Interrupting RPC Client calls can lead to thread exhaustion. #4527
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. |
|
@omalley I'm very happy that you noticing this issue and working on it. This problem occurs frequently in out prod environment when the network is abnormal.
In addition to guaranteeing that only one request is sent at the same time, does it need to guarantee the order of sending? |
|
The extra thread is used so that if the calling thread is interrupted while the request is being written to the socket, that the write is not interrupted. Basically, it is ensuring that the socket doesn't have partial requests sent to it. Without that, Hadoop would need to resynchronize by closing the socket. |
|
My patch also guarantees that the requests are written in the order they arrived, which the current code does not. |
Nice explain, I learned a log. Thanks very much. |
|
+1 (non-binding). lets make the checkstyle happy as well |
|
@steveloughran Can you recommend someone to review this RPC patch? |
|
💔 -1 overall
This message was automatically generated. |
|
Ask on the HDEFS mailing list; they are the ones that get unhappy first when things break. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
Outdated
Show resolved
Hide resolved
|
🎊 +1 overall
This message was automatically generated. |
Hexiaoqiao
left a comment
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.
@omalley Thanks for your works. Leave one question I am very clear. Others look good to me.
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
Show resolved
Hide resolved
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
Outdated
Show resolved
Hide resolved
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
Outdated
Show resolved
Hide resolved
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
Show resolved
Hide resolved
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
Outdated
Show resolved
Hide resolved
38169e5 to
4df3227
Compare
|
Sorry, I got busy with other work. I've included fixes that we've deployed for a while now. I had missed some cases of IOException handling and start up issues. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
ZanderXu
left a comment
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.
LGTM. Thanks @omalley for your update.
…tion. (#4527) * Exactly 1 sending thread per an RPC connection. * If the calling thread is interrupted before the socket write, it will be skipped instead of sending it anyways. * If the calling thread is interrupted during the socket write, the write will finish. * RPC requests will be written to the socket in the order received. * Sending thread is only started by the receiving thread. * The sending thread periodically checks the shouldCloseConnection flag.
…tion. (#4527) * Exactly 1 sending thread per an RPC connection. * If the calling thread is interrupted before the socket write, it will be skipped instead of sending it anyways. * If the calling thread is interrupted during the socket write, the write will finish. * RPC requests will be written to the socket in the order received. * Sending thread is only started by the receiving thread. * The sending thread periodically checks the shouldCloseConnection flag.
…tion. (#4527) * Exactly 1 sending thread per an RPC connection. * If the calling thread is interrupted before the socket write, it will be skipped instead of sending it anyways. * If the calling thread is interrupted during the socket write, the write will finish. * RPC requests will be written to the socket in the order received. * Sending thread is only started by the receiving thread. * The sending thread periodically checks the shouldCloseConnection flag.
…tion. (apache#4527) * Exactly 1 sending thread per an RPC connection. * If the calling thread is interrupted before the socket write, it will be skipped instead of sending it anyways. * If the calling thread is interrupted during the socket write, the write will finish. * RPC requests will be written to the socket in the order received. * Sending thread is only started by the receiving thread. * The sending thread periodically checks the shouldCloseConnection flag.
…d exhaustion. (apache#4527)" Pulling out of this release because of the problems of HDFS-16853 This reverts commit bc4d7b4.
Description of PR
I modified the RPC Connection class to use a single thread that does the writes to the socket instead of a thread factory. (It already has a different thread that does the reads.) Java’s concurrency library has a SynchronousQueue that will simplify hand offs from the calling thread to the rpc sending thread.
As a result, we’ll end up with:
How was this patch tested?
Added a unit test.