Skip to content

Worker channel restart can spend too long canceling active invocations #11845

Description

@jviau

public void Shutdown(Exception workerException)

WorkerChannel.Shutdown will loop through all active invocations and terminate them one by one. This is good to avoid orphaned invocations during a worker restart, but it has introduced a different issue. With a high enough active invocations, the process of looping through these invocations can itself take so long new invocations will fail.

This is because we do not start deferring incoming invocations until after the Shutdown method. Taking too long to process the shutdown creates a time window when all new invocations will fail with Did not find any initialized language workers exception.

We need to both (1) close this window of delaying invocations and (2) see if we can process these invocation terminations asynchronously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions