HBASE-2443 IPC client can throw NPE if socket creation fails
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@936107 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2b2f1d1670
commit
3cb1168601
|
@ -279,6 +279,8 @@ Release 0.21.0 - Unreleased
|
|||
is a prefix (Todd Lipcon via Stack)
|
||||
HBASE-2463 Various Bytes.* functions silently ignore invalid arguments
|
||||
(Benoit Sigoure via Stack)
|
||||
HBASE-2443 IPC client can throw NPE if socket creation fails
|
||||
(Todd Lipcon via Stack)
|
||||
|
||||
IMPROVEMENTS
|
||||
HBASE-1760 Cleanup TODOs in HTable
|
||||
|
|
|
@ -351,10 +351,12 @@ public class HBaseClient {
|
|||
private void handleConnectionFailure(
|
||||
int curRetries, int maxRetries, IOException ioe) throws IOException {
|
||||
// close the current connection
|
||||
try {
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Not able to close a socket", e);
|
||||
if (socket != null) { // could be null if the socket creation failed
|
||||
try {
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Not able to close a socket", e);
|
||||
}
|
||||
}
|
||||
// set socket to null so that the next call to setupIOstreams
|
||||
// can start the process of connect all over again.
|
||||
|
|
Loading…
Reference in New Issue