Skip to content

Wait for the broker schema agent to launch in startBrokerAgent - #415

Merged
cstns merged 1 commit into
mainfrom
8619-await-broker-agent-start
Oct 14, 2026
Merged

cstns merged 1 commit into
mainfrom
8619-await-broker-agent-start

Conversation

@cstns

@cstns cstns commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #414

Merge order: this, FlowFuse/driver-localfs#363 and FlowFuse/driver-docker#254 go first and get released, then FlowFuse/flowfuse#8917 together with bumping the driver versions.

startBrokerAgent kicked off createMQTTTopicAgent without awaiting it, so it resolved before the deployment and service were created. A suspend landing in that gap fails on the service that doesn't exist yet (logged, and the pod/deployment deletes after it are skipped), and the deployment gets created afterwards with no record of it on the platform (FlowFuse/flowfuse#8619). It now awaits the create. createMQTTTopicAgent already catches and logs its own errors, so this doesn't change what the caller sees on failure.

Not touched here, but might be worth a separate look: since a missing service skips the deployment delete, a deployment whose service is gone for any other reason won't get cleaned up by stopBrokerAgent either.

Same change as FlowFuse/driver-localfs#363, which I raced against the local app (0 orphans out of 24 together with FlowFuse/flowfuse#8917). I don't have a cluster to run the platform on locally, so this one is from reading the code. Lint passes.

startBrokerAgent returned before the agent was launched, so a suspend arriving in that window found nothing to stop and the agent kept running with no record of it. The platform now needs this call to only resolve once the agent is actually up.

@hardillb hardillb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just because we await the creation of the k8s objects doesn't mean they are running yet, they may be blocked waiting on k8s resources (e.g. a new node)

@cstns
cstns merged commit 783ab80 into main Oct 14, 2026
5 checks passed
@cstns
cstns deleted the 8619-await-broker-agent-start branch October 14, 2026 14:01
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.

Wait for the broker schema agent deployment before reporting it started

2 participants