소스 검색

HDFS-9749: libhdfs++: RPC engine will attempt to close an asio socket before it's been opened. Contributed by James Clampffer

Bob Hansen 9 년 전
부모
커밋
f591b95e08
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_connection.h

+ 4 - 2
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_connection.h

@@ -282,8 +282,10 @@ void RpcConnectionImpl<NextLayer>::Disconnect() {
   assert(lock_held(connection_state_lock_));  // Must be holding lock before calling
 
   request_over_the_wire_.reset();
-  next_layer_.cancel();
-  next_layer_.close();
+  if (connected_) {
+    next_layer_.cancel();
+    next_layer_.close();
+  }
   connected_ = false;
 }
 }