Skip to content

feat/Broker status - version/image extraction improvements#243

Open
azun wants to merge 2 commits intomasterfrom
feature/reconcile-improvements
Open

feat/Broker status - version/image extraction improvements#243
azun wants to merge 2 commits intomasterfrom
feature/reconcile-improvements

Conversation

@azun
Copy link
Copy Markdown

@azun azun commented Apr 16, 2026

Description

Performance improvements: parallel scrape for broker version and image.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@azun azun changed the title feat/Broker version extraction improvements feat/Broker status - version/image extraction improvements Apr 16, 2026
@dobrerazvan
Copy link
Copy Markdown

How did you find that slow function (updateStatusWithDockerImageAndVersion)?

@azun azun force-pushed the feature/reconcile-improvements branch from bc10845 to fbb56a9 Compare April 20, 2026 12:51
@azun
Copy link
Copy Markdown
Author

azun commented Apr 20, 2026

How did you find that slow function (updateStatusWithDockerImageAndVersion)?

operator was logging status updates for each broker every 5-15s

app: kafka-operator
component: operator
endpoints:
- interval: {{ .Values.prometheusMetrics.interval }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
- interval: {{ .Values.prometheusMetrics.interval }}
- interval: {{ .Values.prometheusMetrics.podMonitor.interval }}

Comment on lines +26 to +27
app: kafka-operator
component: operator
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
app: kafka-operator
component: operator
app.kubernetes.io/name: {{ include "kafka-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: operator

matchLabels in the spec:selector:matchLabels: is immutable and we already have the necessary labels to identify the operator pod.

Comment on lines +138 to +139
app: kafka-operator
component: operator
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
app: kafka-operator
component: operator

Comment on lines +120 to +121
app: kafka-operator
component: operator
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
app: kafka-operator
component: operator

r.KafkaCluster.Spec.GetClusterImage(), r.KafkaCluster.Spec.HeadlessServiceEnabled)
if err != nil {
return err
func (r *Reconciler) updateStatusWithDockerImageAndVersion(brokers map[int32]*banzaiv1beta1.BrokerConfig, log logr.Logger) error {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Goroutines have no cancellation path. If the controller shuts down mid-reconcile, these goroutines run to completion (or until JMX times out). Worth passing a context.Context from the reconcile call if JMX extraction can be long-running.

result := <-ch
if result.err != nil {
return result.err
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Drain the hole channel first then update the broker status so all or none are updated.

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