Skip to content

Commit 16fef39

Browse files
Akka.Coordination: minor cleanup (#5074)
1 parent 95cdfac commit 16fef39

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/core/Akka.Cluster/SBR/SplitBrainResolver.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ private void OnAcquireLease()
374374
{
375375
Log.Debug("SBR trying to acquire lease");
376376
//implicit val ec: ExecutionContext = internalDispatcher
377+
377378
Strategy.Lease?.Acquire().ContinueWith(r =>
378379
{
379380
if (r.IsFaulted)
@@ -385,7 +386,7 @@ private void OnAcquireLease()
385386

386387
public Receive WaitingForLease(IDecision decision)
387388
{
388-
bool Receive(object message)
389+
bool ReceiveLease(object message)
389390
{
390391
switch (message)
391392
{
@@ -426,7 +427,7 @@ bool Receive(object message)
426427
}
427428

428429
Stash.UnstashAll();
429-
Context.Become(Receive);
430+
Context.Become(ReceiveLease);
430431
return true;
431432

432433
case ReleaseLeaseResult lr:
@@ -441,7 +442,7 @@ bool Receive(object message)
441442
}
442443
}
443444

444-
return Receive;
445+
return ReceiveLease;
445446
}
446447

447448
private void OnReleaseLeaseResult(bool released)

src/core/Akka.Coordination/LeaseProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static LeaseProvider Get(ActorSystem system)
8383
}
8484

8585
private readonly ExtendedActorSystem _system;
86-
private readonly ConcurrentDictionary<LeaseKey, Lease> leases = new ConcurrentDictionary<LeaseKey, Lease>();
86+
private readonly ConcurrentDictionary<LeaseKey, Lease> _leases = new ConcurrentDictionary<LeaseKey, Lease>();
8787

8888
private ILoggingAdapter _log;
8989

@@ -122,7 +122,7 @@ public Lease GetLease(string leaseName, string configPath, string ownerName)
122122
{
123123
var leaseKey = new LeaseKey(leaseName, configPath, ownerName);
124124

125-
return leases.GetOrAdd(leaseKey, lk =>
125+
return _leases.GetOrAdd(leaseKey, lk =>
126126
{
127127
var leaseConfig = _system.Settings.Config
128128
.GetConfig(configPath)
@@ -151,7 +151,7 @@ public Lease GetLease(string leaseName, string configPath, string ownerName)
151151
Log.Error(
152152
ex,
153153
"Invalid lease configuration for leaseName [{0}], configPath [{1}] lease-class [{2}]. " +
154-
"The class must implement scaladsl.Lease or javadsl.Lease and have constructor with LeaseSettings parameter and " +
154+
"The class must implement Akka.Coordination.Lease and have constructor with LeaseSettings parameter and " +
155155
"optionally ActorSystem parameter.",
156156
settings.LeaseName,
157157
configPath,

0 commit comments

Comments
 (0)