ret->checkFunction= boost::get<DownstreamState::checkfunc_t>(vars["checkFunction"]);
}
+ if(vars.count("checkTimeout")) {
+ ret->checkTimeout = std::stoi(boost::get<string>(vars["checkTimeout"]));
+ }
+
if(vars.count("setCD")) {
ret->setCD=boost::get<bool>(vars["setCD"]);
}
return false;
}
- int ret=waitForRWData(sock.getHandle(), true, 1, 0);
+ int ret = waitForRWData(sock.getHandle(), true, /* ms to seconds */ ds.checkTimeout / 1000, /* remaining ms to us */ (ds.checkTimeout % 1000) * 1000);
if(ret < 0 || !ret) { // error, timeout, both are down!
if (ret < 0) {
ret = errno;
const unsigned int sourceItf{0};
uint16_t retries{5};
uint16_t xpfRRCode{0};
+ uint16_t checkTimeout{1000}; /* in milliseconds */
uint8_t currentCheckFailures{0};
uint8_t maxCheckFailures{1};
StopWatch sw;
- Added ``sockets`` to server_table
- Added ``checkFunction`` to server_table
+ .. versionchanged:: 1.3.4
+ - Added ``checkTimeout`` to server_table
Add a new backend server. Call this function with either a string::
checkName=STRING, -- Use STRING as QNAME in the health-check query, default: "a.root-servers.net."
checkType=STRING, -- Use STRING as QTYPE in the health-check query, default: "A"
checkFunction=FUNCTION -- Use this function to dynamically set the QNAME, QTYPE and QCLASS to use in the health-check query (see :ref:`Healthcheck`)
+ checkTimeout=NUM -- The timeout (in milliseconds) of a health-check query, default: 1000 (1s)
setCD=BOOL, -- Set the CD (Checking Disabled) flag in the health-check query, default: false
maxCheckFailures=NUM, -- Allow NUM check failures before declaring the backend down, default: 1
mustResolve=BOOL, -- Set to true when the health check MUST return a NOERROR RCODE and an answer