Skip to content

Commit

Permalink
added some comments to mention default timeout to close descDb stream.
Browse files Browse the repository at this point in the history
Signed-off-by: Rahman Abber Tahir <[email protected]>
  • Loading branch information
Rahman Abber Tahir committed Dec 4, 2023
1 parent 6929a23 commit 117c215
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/libCli/Call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ namespace cli

//before calling the RPC, close the DescDb connection with a default timeout. We still continue with rpc call
//but remove the cache file if the stream was not closed gracefully so it fetches the reflection data again next time.
grpc::Status dbDescStatus = ConnectionManager::getInstance().closeDescDbStream(serverAddress);
ConnectionManager::getInstance().closeDescDbStream(serverAddress);

grpc::testing::CliCall call(channel, methodStr, clientMetadata, deadline);

Expand Down
2 changes: 1 addition & 1 deletion src/libCli/ConnectionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace cli
return grpc::Status( grpc::StatusCode::ABORTED, "descDbProxy has not been initialized.");
}

//if proxy exists close the stream with a deadline.
//if proxy exists close the stream.
grpc::Status status = m_connections[f_serverAddress].descDbProxy->closeDescDbStream();

//delete the proxy, findChannelByAddress() protects from accessing uninitialzed DbProxy.
Expand Down
2 changes: 1 addition & 1 deletion src/libCli/libCli/ConnectionManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace cli
/// @returns the gRpc DescriptorPool of the corresponding server address.
std::shared_ptr<grpc::protobuf::DescriptorPool> getDescPool(std::string f_serverAddress, ArgParse::ParsedElement &f_parseTree);

/// @brief closes the DescDb stream with a default deadline.
/// @brief closes the DescDb stream with a default deadline of 2 seconds.
/// @param f_serverAddress server addresss to lookup the assigned DescDbProxy.
/// @return returns grpc::StatusCode::ABORTED status if no DescDb proxy is attached to the server address,
/// otherwise grpc status as a result of stream closure.
Expand Down

0 comments on commit 117c215

Please sign in to comment.