Commit 5938564a authored by Libor Peltan's avatar Libor Peltan

parent DS query: logging fail even if outside of consume phase

parent a266c427
......@@ -35,6 +35,7 @@ struct ds_query_data {
zone_key_t *key;
bool ds_ok;
bool result_logged;
};
static int ds_query_begin(knot_layer_t *layer, void *params)
......@@ -63,6 +64,7 @@ static int ds_query_produce(knot_layer_t *layer, knot_pkt_t *pkt)
static int ds_query_consume(knot_layer_t *layer, knot_pkt_t *pkt)
{
struct ds_query_data *data = layer->data;
data->result_logged = true;
if (knot_pkt_ext_rcode(pkt) != KNOT_RCODE_NOERROR) {
ns_log(LOG_WARNING, data->zone->name, LOG_OPERATION_PARENT,
......@@ -117,6 +119,7 @@ static int try_ds(conf_t *conf, zone_t *zone, const conf_remote_t *parent, zone_
.remote = (struct sockaddr *)&parent->addr,
.key = key,
.ds_ok = false,
.result_logged = false,
};
struct knot_requestor requestor;
......@@ -148,6 +151,11 @@ static int try_ds(conf_t *conf, zone_t *zone, const conf_remote_t *parent, zone_
ret = KNOT_ENORECORD;
}
if (ret != KNOT_EOK && !data.result_logged) {
ns_log(LOG_WARNING, zone->name, LOG_OPERATION_PARENT,
LOG_DIRECTION_OUT, data.remote, "failed (%s)", knot_strerror(ret));
}
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment