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

drop consumers if their out buffer fills up #417

Merged
merged 5 commits into from
Nov 9, 2023

Conversation

whyrusleeping
Copy link
Collaborator

right now if these buffers fill up we just start dropping events, and then when the buffers drain we just resume sending events. this seems quite wrong.

@whyrusleeping
Copy link
Collaborator Author

hrm.... this isnt quite right, it doesnt close out the connections and will result in a hanging subscriber

@whyrusleeping
Copy link
Collaborator Author

This should work now

Copy link
Collaborator

@ericvolp12 ericvolp12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ericvolp12
Copy link
Collaborator

Actually we should probably emit a ConsumerTooSlow Error Event as well before closing

events/events.go Outdated Show resolved Hide resolved
events/events.go Outdated
go func(torem *Subscriber) {
em.rmSubscriber(torem)
select {
case s.outgoing <- &XRPCStreamEvent{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be torem.outgoing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch reviewer.

events/events.go Outdated
},
}:
case <-time.After(time.Second * 5):
log.Warnw("failed to send error frame to backed up consumer", "ident", s.ident)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be torem.ident

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah dammit

Copy link
Collaborator

@ericvolp12 ericvolp12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM again

@whyrusleeping whyrusleeping merged commit d47a672 into main Nov 9, 2023
6 checks passed
@whyrusleeping whyrusleeping deleted the fix/drop-slow-consumers branch November 9, 2023 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants