@@ -19,21 +19,25 @@ namespace Proto.Cluster;
19
19
20
20
public class DefaultClusterContext : IClusterContext
21
21
{
22
+ #pragma warning disable CS0618 // Type or member is obsolete
23
+ private static readonly ILogger Logger = Log . CreateLogger < DefaultClusterContext > ( ) ;
24
+ #pragma warning restore CS0618 // Type or member is obsolete
25
+
22
26
private readonly IIdentityLookup _identityLookup ;
23
-
24
27
private readonly PidCache _pidCache ;
25
28
private readonly ShouldThrottle _requestLogThrottle ;
26
29
private readonly ActorSystem _system ;
27
- private static readonly ILogger Logger = Log . CreateLogger < DefaultClusterContext > ( ) ;
28
30
private readonly int _requestTimeoutSeconds ;
29
31
private readonly bool _legacyTimeouts ;
32
+ private readonly Cluster _cluster ;
30
33
31
34
public DefaultClusterContext ( Cluster cluster )
32
35
{
33
36
_identityLookup = cluster . IdentityLookup ;
34
37
_pidCache = cluster . PidCache ;
35
38
var config = cluster . Config ;
36
39
_system = cluster . System ;
40
+ _cluster = cluster ;
37
41
38
42
_requestLogThrottle = Throttle . Create (
39
43
config . MaxNumberOfEventsInRequestLogThrottlePeriod ,
@@ -48,6 +52,11 @@ public DefaultClusterContext(Cluster cluster)
48
52
public async Task < T ? > RequestAsync < T > ( ClusterIdentity clusterIdentity , object message , ISenderContext context ,
49
53
CancellationToken ct )
50
54
{
55
+ if ( ! _cluster . JoinedCluster . IsCompletedSuccessfully )
56
+ {
57
+ await _cluster . JoinedCluster ;
58
+ }
59
+
51
60
var i = 0 ;
52
61
53
62
var future = context . GetFuture ( ) ;
0 commit comments