Skip to content

Possible memory leak in listenQueues on listener disconnect #362

@raballew

Description

@raballew

Description

I think this might be a memory leak.

At controller/internal/service/controller_service.go:442, Listen() creates an entry in the listenQueues sync.Map via LoadOrStore. When the listener disconnects (ctx.Done at line 445 or stream.Send failure at line 449), the function returns without removing the entry.

There is no listenQueues.Delete() call anywhere in the codebase, so channels accumulate in the map over time as leases are created and disconnected.

Suggested Fix

  • Add defer s.listenQueues.Delete(leaseName) after the LoadOrStore call

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions