Skip to content

StatefulSet scheduler fails when not all dispatchers are installed #4604

@Cali0707

Description

@Cali0707

Describe the bug
The statefulset scheduler/scaler is supposed to determine when to scale up the dispatcher statefulsets based on the number of consumers in the cluster.

Currently, it seems to fail when not all the dispatchers are installed.

Expected behavior
It should work if only one or two of the dispatchers are installed

To Reproduce
Follow the setup steps in https://github.com/tansu-io/example-knative/

You will see logs like:

{"level":"error","ts":"2025-12-03T00:15:42.476Z","logger":"kafka-broker-controller","caller":"statefulset/autoscaler.go:157","msg":"Failed to sync autoscale","commit":"9e3466a-dirty","knative.dev/pod":"kafka-controller-8656c776c5-9j9zh","error":"failed to do autoscale: statefulsets.apps \"kafka-channel-dispatcher\" not found","stacktrace":"knative.dev/eventing/pkg/scheduler/statefulset.(*autoscaler).Start\n\tknative.dev/eventing@v0.47.0/pkg/scheduler/statefulset/autoscaler.go:157\nknative.dev/eventing/pkg/scheduler/statefulset.New.func2\n\tknative.dev/eventing@v0.47.0/pkg/scheduler/statefulset/scheduler.go:93"}

Knative release version
1.20.0

Additional context
Add any other context about the problem here such as proposed priority

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions