Skip to content

Commit

Permalink
frontend.c: free back conn if exists (#683)
Browse files Browse the repository at this point in the history
There are some cases, when catchup timeout can occur with client with
backend connection (when lag appears after conn has been taken.

This patch adds router closing for this cases.

Signed-off-by: Roman Khapov <[email protected]>
Co-authored-by: Roman Khapov <[email protected]>
  • Loading branch information
rkhapov and Roman Khapov authored Sep 6, 2024
1 parent 000944f commit 1b1d947
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sources/frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1928,8 +1928,9 @@ static void od_frontend_cleanup(od_client_t *client, char *context,
client, KIWI_CONNECTION_FAILURE,
"remote server read/write error: failed to wait replica for catchup");

/* no backend connection should be acquired to this client */
assert(client->server == NULL);
if (client->server != NULL) {
od_router_close(router, client);
}
break;
case OD_ESERVER_READ:
case OD_ESERVER_WRITE:
Expand Down

0 comments on commit 1b1d947

Please sign in to comment.