You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2019/01/10 18:28:32 UTC

[GitHub] asfgit closed pull request #471: MINIFICPP-709: Add timeout

asfgit closed pull request #471: MINIFICPP-709: Add timeout
URL: https://github.com/apache/nifi-minifi-cpp/pull/471
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/libminifi/src/RemoteProcessorGroupPort.cpp b/libminifi/src/RemoteProcessorGroupPort.cpp
index cbc0412f..54329f8b 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_);
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services