Skip to content

Commit

Permalink
Add missing error signaling
Browse files Browse the repository at this point in the history
(cherry picked from commit 5b82ef4)
  • Loading branch information
Neverlord authored and timwoj committed Aug 26, 2022
1 parent 39539ad commit 2b3d99e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/internal/connector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1302,16 +1302,20 @@ 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"
<< entry.fd << "-> try again in" << retry_interval);
} 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);
Expand Down

0 comments on commit 2b3d99e

Please sign in to comment.