Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network errors not propagating up to RegisterNetworkErrorListener #124

Closed
dirkmc opened this issue Dec 4, 2020 · 0 comments · Fixed by #127
Closed

Network errors not propagating up to RegisterNetworkErrorListener #124

dirkmc opened this issue Dec 4, 2020 · 0 comments · Fixed by #127
Labels
need/triage Needs initial labeling and prioritization

Comments

@dirkmc
Copy link
Collaborator

dirkmc commented Dec 4, 2020

It seems that a listener registered with RegisterNetworkErrorListener() will not receive errors emitted by the message queue.

For example the error events published on lines 178 and 187 of messagequeue.go:

func (mq *MessageQueue) sendMessage() {
message, topic := mq.extractOutgoingMessage()
if message == nil || message.Empty() {
return
}
mq.eventPublisher.Publish(topic, Event{Name: Queued, Err: nil})
defer mq.eventPublisher.Close(topic)
err := mq.initializeSender()
if err != nil {
log.Infof("cant open message sender to peer %s: %s", mq.p, err)
// TODO: cant connect, what now?
mq.eventPublisher.Publish(topic, Event{Name: Error, Err: fmt.Errorf("cant open message sender to peer %s: %w", mq.p, err)})
return
}
for i := 0; i < maxRetries; i++ { // try to send this message until we fail.
if mq.attemptSendAndRecovery(message, topic) {
return
}
}
mq.eventPublisher.Publish(topic, Event{Name: Error, Err: fmt.Errorf("expended retries on SendMsg(%s)", mq.p)})
}

@dirkmc dirkmc added the need/triage Needs initial labeling and prioritization label Dec 4, 2020
marten-seemann pushed a commit that referenced this issue Mar 2, 2023
* fix: better retry config

* docs: fix TestSendMessageRetry comment

Co-authored-by: Anton Evangelatov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
1 participant