dotnet / dotnet/orleans

Throw if `IGrainFactory.GetGrain<T>` is called before client is fully initialized

Open
#8,449 0 comments 0 reactions 1 assignee Claimed by @ReubenBond View on GitHub
Needs: triage :mag:
Dominant language
C#
Stars
10.9k
Forks
2.1k
Avg merge
14h 42m
Merged PRs (30d)
354

Description

We ought to at least throw an informative error message in this case.

Alternatively, we could create an instance of the target grain reference without a valid `GrainType` and resolve the grain type + update the reference once the client does connect. This would likely give the best user experience, but it's complicated because we need to capture everything required to resolve the grain call. Potentially, we could allocate some class which represents the `GetGrain` method call as well as target method call, the and attach it to the `GrainReference`.
There is also the chance that a grain call is preventing startup (user error), so we should likely emit a warning log if the client has not begun initialization.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.