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

[m3msg] Remove unnecessary ConsumeHandler interface #3918

Merged
merged 3 commits into from
Nov 10, 2021

Conversation

ryanhall07
Copy link
Collaborator

The ConsumerHandler is redundant and unncessary. Use the
MessageProcessor interface for the aggregator so it's consistent with
the coordinator.

This will make it easier to add some base metrics to both consumers in
the future.

What this PR does / why we need it:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing and/or backwards incompatible change?:


Does this PR require updating code package or user-facing documentation?:


@ryanhall07 ryanhall07 requested a review from arnikola November 10, 2021 16:38
@ryanhall07 ryanhall07 changed the title [m3msg] Remove unecessary ConsumeHandler interface [m3msg] Remove unnecessary ConsumeHandler interface Nov 10, 2021
The ConsumerHandler is redundant and unncessary. Use the
MessageProcessor interface for the aggregator so it's consistent with
the coordinator.

This will make it easier to add some base metrics to both consumers in
the future.
@ryanhall07 ryanhall07 force-pushed the rhall-agg-message-processor branch from b968d34 to d244307 Compare November 10, 2021 20:08
Copy link
Collaborator

@arnikola arnikola left a comment

Choose a reason for hiding this comment

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

lgtm!

Comment on lines 39 to 47
// NewMessageProcessorFn creates a new MessageProcessor scoped to a single connection. Messages are processed serially
// in a connection.
type NewMessageProcessorFn func() MessageProcessor

type messageHandler struct {
opts Options
mPool *messagePool
mp MessageProcessor
m metrics
// SingletonMessageProcessor uses the same MessageProcessor for all connections.
func SingletonMessageProcessor(p MessageProcessor) NewMessageProcessorFn {
return func() MessageProcessor {
return p
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: move to types.go

@ryanhall07 ryanhall07 enabled auto-merge (squash) November 10, 2021 20:58
@ryanhall07 ryanhall07 disabled auto-merge November 10, 2021 20:58
@ryanhall07 ryanhall07 enabled auto-merge (squash) November 10, 2021 20:58
@ryanhall07 ryanhall07 merged commit 13e4c45 into master Nov 10, 2021
@ryanhall07 ryanhall07 deleted the rhall-agg-message-processor branch November 10, 2021 21:13
soundvibe added a commit that referenced this pull request Nov 11, 2021
* master:
  [m3msg] Remove unnecessary ConsumeHandler interface (#3918)
  [query] Prom converter supporting value decrease tolerance (#3914)
ryanhall07 added a commit that referenced this pull request Nov 19, 2021
This fixes a regression that was introduced in #3918

The shared singleton MessageProcessor was being closed when a Connection
was being closed.

Now a Pool interface is introduced. A MessageProcessor is fetched when a
Connection is created and returned when a Connection is closed. It is up
to the pool impl to decide if it should Close the MessageProcessor on
each return or only when the pool is closed.
ryanhall07 added a commit that referenced this pull request Nov 20, 2021
…ns (#3934)

This fixes a regression that was introduced in #3918

The shared singleton MessageProcessor was being closed when a Connection
was being closed. Now the singleton MessageProcessor is not closed until the server shuts down.
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.

3 participants