Skip to content

Locations can end up being unloaded in spite of the watch thread #17319

Description

@freewilll

Dagster version

1.4.11

What's the issue?

When running in kubernetes, using the default RollingUpdate deployment strategy, during the replacement of the pods, it can happen that one pod is serving traffic and another has shut down. The service layer takes a while to update and round robins across both pods. The grpc watch thread in dagster-webserver detects a location is up by hitting the healthy pod and via on_updated, sends an update message to the WorkspaceProcessContext. It then tries to load the location, hits, the dead pod and fails. In the meantime, the service has been updated and the watch thread keeps hitting the healthy pod. The result is the location ends up being permanently unloaded.

What did you expect to happen?

I expect healthy locations to be (re)loaded.

How to reproduce?

  • Add a 10 second sleep at the top of _start_watch_thread in context.py to simulate a grpc location flipping from unavailable to available
  • Start dagit-webserver with a workspace configured to connect to the grpc location, it will log a failure to load the location
  • Start the location grpc server
  • The watcher starts when the sleep completes and thinks the location is alive

The UI indicates the location isn't loaded and this doesn't change.

Deployment type

Other Docker-based deployment

Deployment details

We use a kubernetes deployment with the default RollingUpdate strategy.

Additional information

No response

Message from the maintainers

Impacted by this issue? Give it a 👍! We factor engagement into prioritization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions