You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by al...@apache.org on 2019/01/10 18:28:23 UTC

[nifi-minifi-cpp] branch master updated: MINIFICPP-709: Add timeout

This is an automated email from the ASF dual-hosted git repository.

aldrin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new c5603ef  MINIFICPP-709: Add timeout
c5603ef is described below

commit c5603ef77ff53d7fca1bef09ffc1a8e35aae7870
Author: Marc Parisi <ph...@apache.org>
AuthorDate: Thu Jan 10 12:05:10 2019 -0500

    MINIFICPP-709: Add timeout
    
    This closes #471.
    
    Signed-off-by: Aldrin Piri <al...@apache.org>
---
 libminifi/src/RemoteProcessorGroupPort.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libminifi/src/RemoteProcessorGroupPort.cpp b/libminifi/src/RemoteProcessorGroupPort.cpp
index cbc0412..54329f8 100644
--- a/libminifi/src/RemoteProcessorGroupPort.cpp
+++ b/libminifi/src/RemoteProcessorGroupPort.cpp
@@ -292,6 +292,9 @@ std::pair<std::string, int> RemoteProcessorGroupPort::refreshRemoteSite2SiteInfo
       }
       client = std::unique_ptr<utils::BaseHTTPClient>(dynamic_cast<utils::BaseHTTPClient*>(client_ptr));
       client->initialize("GET", loginUrl.str(), ssl_service);
+      // use a connection timeout. if this times out we will simply attempt re-connection
+      // so no need for configuration parameter that isn't already defined in Processor
+      client->setConnectionTimeout(10);
 
       token = utils::get_token(client.get(), this->rest_user_name_, this->rest_password_);
       logger_->log_debug("Token from NiFi REST Api endpoint %s,  %s", loginUrl.str(), token);
@@ -307,6 +310,9 @@ std::pair<std::string, int> RemoteProcessorGroupPort::refreshRemoteSite2SiteInfo
     int siteTosite_port_ = -1;
     client = std::unique_ptr<utils::BaseHTTPClient>(dynamic_cast<utils::BaseHTTPClient*>(client_ptr));
     client->initialize("GET", fullUrl.str().c_str(), ssl_service);
+    // use a connection timeout. if this times out we will simply attempt re-connection
+    // so no need for configuration parameter that isn't already defined in Processor
+    client->setConnectionTimeout(10);
     if (!proxy_.host.empty()) {
       client->setHTTPProxy(proxy_);
     }