diff --git a/patches/series b/patches/series index fd7a18b..66384c7 100644 --- a/patches/series +++ b/patches/series @@ -8,3 +8,4 @@ make-rc-unit-test.patch flaky-test_fix.patch async-transaction.patch plus_one.patch +transport-timeout-interval.patch diff --git a/patches/transport-timeout-interval.patch b/patches/transport-timeout-interval.patch new file mode 100644 index 0000000..315f768 --- /dev/null +++ b/patches/transport-timeout-interval.patch @@ -0,0 +1,89 @@ +Adds timeoutIntervals argument. + +This controls the variable of same name in BasicTransport.cc + +From: Ofer Gill +--- + src/BasicTransport.cc | 6 ++++++ + src/OptionParser.cc | 5 +++++ + src/OptionParser.h | 13 ++++++++++++- + 3 files changed, 23 insertions(+), 1 deletion(-) + +diff --git a/src/BasicTransport.cc b/src/BasicTransport.cc +index 5253669a..8073d8f0 100644 +--- a/src/BasicTransport.cc ++++ b/src/BasicTransport.cc +@@ -15,6 +15,7 @@ + #include + + #include "BasicTransport.h" ++#include "OptionParser.h" + #include "Service.h" + #include "TimeTrace.h" + #include "WorkerManager.h" +@@ -110,6 +111,11 @@ BasicTransport::BasicTransport(Context* context, const ServiceLocator* locator, + timerInterval = Cycles::fromMicroseconds(2000); + nextTimeoutCheck = Cycles::rdtsc() + timerInterval; + ++ if ((context->options != NULL) && ++ (context->options->getTimeoutIntervals() != 0)) { ++ timeoutIntervals = context->options->getTimeoutIntervals(); ++ } ++ + LOG(NOTICE, "BasicTransport parameters: maxDataPerPacket %u, " + "roundTripBytes %u, grantIncrement %u, pingIntervals %d, " + "timeoutIntervals %d, timerInterval %.2f ms", +diff --git a/src/OptionParser.cc b/src/OptionParser.cc +index 0b89f4db..ac233aac 100644 +--- a/src/OptionParser.cc ++++ b/src/OptionParser.cc +@@ -231,6 +231,11 @@ OptionParser::setup(int argc, char* argv[]) + "How long transports should wait (ms) before declaring that a " + "client connection for each rpc session is dead." + "0 means use transport-specific default.") ++ ("timeoutIntervals", ++ ProgramOptions::value(&options.timeoutIntervals)-> ++ default_value(0), ++ "How many intervals (attempts) in an rpc session to try with the " ++ "client connection before declaring that session is dead.") + ("dpdkPort", + ProgramOptions::value(&options.dpdkPort)-> + default_value(-1), +diff --git a/src/OptionParser.h b/src/OptionParser.h +index b715995b..0bd52f97 100644 +--- a/src/OptionParser.h ++++ b/src/OptionParser.h +@@ -48,6 +48,7 @@ class CommandLineOptions { + , externalStorageLocator() + , pcapFilePath() + , sessionTimeout(0) ++ , timeoutIntervals(0) + , portTimeout(0) + , clusterName() + , configDir() +@@ -118,6 +119,15 @@ class CommandLineOptions { + return sessionTimeout; + } + ++ /** ++ * Returns the number of intervals (attempts) the transport should use ++ * in an rpc session before assuming the connection has failed. ++ */ ++ uint32_t getTimeoutIntervals() const ++ { ++ return timeoutIntervals; ++ } ++ + /** + * Returns the time (in ms) after which transports should assume that + * the client for the lisning port is dead. +@@ -168,7 +178,8 @@ class CommandLineOptions { + string externalStorageLocator; ///< See getExternalStorageLocator(). + string pcapFilePath; ///< Packet log file, "" to disable. + uint32_t sessionTimeout; ///< See getSessionTimeout(). +- int32_t portTimeout; ///< See getSessionTimeout(). ++ uint32_t timeoutIntervals; ///< See getTimeoutIntervals(). ++ int32_t portTimeout; ///< See getPortTimeout(). + string clusterName; ///< See getClusterName(). + string configDir; ///< See getConfigDir(). + int dpdkPort; ///< See getDpdkPort().