Skip to content

Data source can shut down with no way to detect it #116

@teskje

Description

@teskje

Describe the bug

Both StreamingDataSource and PollingDataSource spawn a task that fetches new events in the background and writes them to the data store. There are various ways in which fetching events can fail, causing the data source's fetch loop to break and the task to shut down. For example, the StreamingDataSource breaks when the event stream returns any error other than Eof.

When the fetch task shuts down, the data source becomes dysfunctional. As far as I can tell, there is no way for the user to detect that. The LD sync silently breaks with no way to learn about it and retry. This makes it impossible to use the SDK in production systems where being able to reliably push config updates is critical.

Expected behavior

There are several ways to solve this:

  • Make the state of the data source observable. If the SDK client can detect that the fetch task has shut down, it can arrange for a reconnect.
  • Implement retries inside the fetch task instead of shutting it down.

Imo the first solution is preferable because it makes it enables flexible handling of error conditions and provides a way to react if the LD connection is permanently broken. Having both would be ideal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions