Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing race on grpc client start #1508

Merged
merged 1 commit into from
May 3, 2023
Merged

fixing race on grpc client start #1508

merged 1 commit into from
May 3, 2023

Conversation

brettsam
Copy link
Member

@brettsam brettsam commented May 3, 2023

There's a possibility that _workerClient is null during initialization.

public async Task StartAsync(CancellationToken token)
{
    _workerClient = await _workerClientFactory.StartClientAsync(this, token);
}

Inside that call we send the StartStream() and start listening... so we can start to get messages sent to us before StartClientAsync() has returned -- leaving _workeClient null.

Change is to make this two distinct calls... one to create the client and another to start it so that it can never be null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants