-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
refactor(blooms): Builder retrieves tasks from planner #13046
refactor(blooms): Builder retrieves tasks from planner #13046
Conversation
// will be canceled and the loop will exit. | ||
protoTask, err := c.Recv() | ||
if err != nil { | ||
if errors.Is(c.Context().Err(), context.Canceled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should check err
for context.Canceled, or, check if c.Context() == nil
before c.Recv()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the connection context is canceled, c.Recv()
will return right after calling it.
(I actually had it as you suggest but noticed the behaviour while testing and decided to remove it for simplicity)
pkg/bloombuild/builder/metrics.go
Outdated
Subsystem: metricsSubsystem, | ||
Name: "task_time_seconds", | ||
Help: "Time spent processing a task.", | ||
Buckets: prometheus.DefBuckets, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default bucket range might be too small.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Changed
pkg/bloombuild/builder/metrics.go
Outdated
Name: "task_completed_total", | ||
Help: "Total number of task completed", | ||
}, []string{"status"}), | ||
taskTime: promauto.With(r).NewHistogramVec(prometheus.HistogramOpts{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: would name it taskDuration
What this PR does / why we need it:
This PR adds the logic to the bloom builder to connect and receive tasks from the bloom planner. Tasks are not processed yet, only received.
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
production/helm/loki/Chart.yaml
and updateproduction/helm/loki/CHANGELOG.md
andproduction/helm/loki/README.md
. Example PRdeprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR