Connection failure should increment server failure count first

In order to be sure a different server is chosen on the next query,
a read error should result in the failure count being updated
first before requeing the request to a different server.

Fix By: Brad House (@bradh352)
v1.23
Brad House 1 year ago
parent 6af142a27a
commit 143e0f1ad4
  1. 9
      src/lib/ares_process.c

@ -747,12 +747,15 @@ static void handle_conn_error(struct server_connection *conn,
{
struct server_state *server = conn->server;
/* This will requeue any connections automatically */
ares__close_connection(conn);
/* Increment failures first before requeue so it is unlikely to requeue
* to the same server */
if (critical_failure) {
server_increment_failures(server);
}
/* This will requeue any connections automatically */
ares__close_connection(conn);
}
ares_status_t ares__requeue_query(struct query *query, struct timeval *now)

Loading…
Cancel
Save