Skip to content

New automatic strategy for ServiceSwitcher that works on service failures #3861

@2010b9

Description

@2010b9

Problem Statement

Currently, there's only one service switcher strategy, which is the ServiceSwitcherStrategyManual. As the name implies, it only works if service is switched explicitly. I believe this could be improved by adding a new strategy that automatically switches to another service when the primary one is down, keeps track of the services' state in the background and switches to the main one once it is healthy again.

Proposed Solution

I think something similar to what Livekit does with their FallbackAdapter could be done for pipecat as well.

When in use, FallbackAdapter handles the following:

  • Automatically resubmits the failed request to backup providers when the primary provider fails.
  • Marks the failed provider as unhealthy and stops sending requests to it.
  • Continues to use the backup providers until the primary provider recovers.
  • Periodically checks the primary provider's status in the background.

Alternative Solutions

No response

Additional Context

No response

Would you be willing to help implement this feature?

  • Yes, I'd like to contribute
  • No, I'm just suggesting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions