Skip to content

Potentially lost dispatches on startup #87

@ela-kotulska-frequenz

Description

@ela-kotulska-frequenz

What happened?

On startup we receive all active dispatches. If there is more then 50 dispatches, they get lost.
To receive dispatches we use frequenz.channels receivers. And its default limit is 50. If there are more then 50 messages, some of them will be lost:
Example from README.md

    dispatcher = Dispatcher(
        microgrid_id=microgrid_id,
        server_url=url,
        key=key
    )
    await dispatcher.start()

    actor = MagicMock() # replace with your actor

    changed_running_status_rx = dispatcher.running_status_change.new_receiver() # HERE RECEIVERS LIMIT IS 50

    async for dispatch in changed_running_status_rx:

What did you expect instead?

Find solution to receive more messages.
or
Define maximum number of active dispatches and return receiver with correct size from dispatcher. :)

class Dispacher:
   fn running_status_change():
      return self.running_status_change.new_receiver(limit=MAX_ACTIVE_DISPATCHES)

Affected version(s)

No response

Affected part(s)

Hight-level interface / Dispatcher (part:dispatcher)

Extra information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    part:dispatcherAffects the high-level dispatcher interfacepriority:❓We need to figure out how soon this should be addressedtype:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions