From 2b3d99e4d7e6efc70c8258dbcb57e03a1165e2ed Mon Sep 17 00:00:00 2001 From: Dominik Charousset Date: Fri, 26 Aug 2022 16:57:12 +0200 Subject: [PATCH] Add missing error signaling (cherry picked from commit 5b82ef4356e2f7bbbaa908149929b332f28dc539) --- src/internal/connector.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/internal/connector.cc b/src/internal/connector.cc index 846fe684..a264d43e 100644 --- a/src/internal/connector.cc +++ b/src/internal/connector.cc @@ -1302,6 +1302,7 @@ struct connect_manager { } else if (state->event_id != invalid_connector_event_id) { auto retry_interval = state->addr.retry; if (retry_interval.count() > 0) { + listener->on_peer_unavailable(state->addr); retry_schedule.emplace(caf::make_timestamp() + retry_interval, std::move(state)); BROKER_DEBUG("failed to connect on socket" @@ -1309,9 +1310,12 @@ struct connect_manager { } else { BROKER_DEBUG("failed to connect on socket" << entry.fd << "-> give up"); - if (valid(state->event_id)) + if (valid(state->event_id)) { listener->on_error(state->event_id, caf::make_error(ec::peer_unavailable)); + } else { + listener->on_peer_unavailable(state->addr); + } } } else { BROKER_DEBUG("incoming peering failed on socket" << entry.fd);