From 303d182d5c9a3fdd8ba199f2bc4afb743d2fe9c4 Mon Sep 17 00:00:00 2001 From: Patrick LeBlanc Date: Mon, 29 Jul 2019 14:44:18 -0500 Subject: [PATCH] Removed a couple unused SM config params. Added retry loop to getting a connection. --- oam/etc/Columnstore.xml | 1 - utils/cloudio/SMComm.cpp | 2 ++ utils/cloudio/SocketPool.cpp | 14 +++++++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/oam/etc/Columnstore.xml b/oam/etc/Columnstore.xml index 693a72944..71a9b45f5 100644 --- a/oam/etc/Columnstore.xml +++ b/oam/etc/Columnstore.xml @@ -549,7 +549,6 @@ 0 - N 30 diff --git a/utils/cloudio/SMComm.cpp b/utils/cloudio/SMComm.cpp index 3ebd6f4a8..6497539e4 100644 --- a/utils/cloudio/SMComm.cpp +++ b/utils/cloudio/SMComm.cpp @@ -46,8 +46,10 @@ SMComm * SMComm::get() // timesavers #define common_exit(bs1, bs2, retCode) \ { \ + int l_errno = errno; \ buffers.returnByteStream(bs1); \ buffers.returnByteStream(bs2); \ + errno = l_errno; \ return retCode; \ } diff --git a/utils/cloudio/SocketPool.cpp b/utils/cloudio/SocketPool.cpp index 12b532f2c..862022abe 100644 --- a/utils/cloudio/SocketPool.cpp +++ b/utils/cloudio/SocketPool.cpp @@ -93,14 +93,22 @@ int SocketPool::send_recv(messageqcpp::ByteStream &in, messageqcpp::ByteStream * ssize_t err = 0; retry: - /* should there be a retry limit here... */ + int retries = 0; while (sock < 0) { sock = getSocket(); if (sock < 0) { - //log(logging::LOG_TYPE_ERROR, "SocketPool::send_recv(): retrying in 5 sec..."); - sleep(1); + if (++retries < 10) + { + //log(logging::LOG_TYPE_ERROR, "SocketPool::send_recv(): retrying in 5 sec..."); + sleep(1); + } + else + { + errno = ECONNREFUSED; + return -1; + } } }