Skip to content

[Multi-provider] outbound event channel sends can block during shutdown #481

@jonathannorris

Description

@jonathannorris

Context

In multiprovider.go, the forwardProviderEvents loop sends events to p.outboundEvents with a direct channel send. If the channel buffer is full, this blocks indefinitely and can stall the forwarding worker, potentially preventing shutdown from completing.

This affects both the ConfigurationChanged pass-through path and the existing state-change forwarding path.

Suggested Fix

Use a select that also listens on workerCtx.Done() so the goroutine can exit cleanly under backpressure or shutdown:

select {
case <-workerCtx.Done():
    return
case p.outboundEvents <- e.Event:
}

Identified during review of #480.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions