Skip to content

Commit d1a6e3c

Browse files
committed
grout: add logs on connection errors
Trace missing connections
1 parent ae69cb6 commit d1a6e3c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

zebra/grout/zebra_dplane_grout.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ static int grout_notif_subscribe(struct gr_api_client **pgr_client, uint32_t *ev
4545
unsigned int i;
4646

4747
*pgr_client = gr_api_client_connect(GR_DEFAULT_SOCK_PATH);
48-
if (*pgr_client == NULL)
48+
if (*pgr_client == NULL) {
49+
gr_log_err("connect failed on grout sock %s error: %s",
50+
GR_DEFAULT_SOCK_PATH, strerror(errno));
4951
return -1;
52+
}
5053

5154
for (i = 0; i < nb_ev_types; i++) {
5255
req.ev_type = ev_types[i];
@@ -150,8 +153,9 @@ int grout_client_send_recv(uint32_t req_type, size_t tx_len, const void *tx_data
150153

151154
grout_ctx.client = gr_api_client_connect(GR_DEFAULT_SOCK_PATH);
152155
if (!grout_ctx.client) {
153-
gr_log_debug("connect failed on grout sock for '%s' request",
154-
gr_req_type_to_str(req_type));
156+
gr_log_debug("connect failed on grout sock %s for '%s' request: %s",
157+
GR_DEFAULT_SOCK_PATH, gr_req_type_to_str(req_type),
158+
strerror(errno));
155159
return -1;
156160
}
157161

0 commit comments

Comments
 (0)