-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Disallow creating a grain activation before a silo is active #9612
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -124,7 +124,7 @@ public IGrainContext GetOrCreateActivation( | |||||||
| return result; | ||||||||
| } | ||||||||
|
|
||||||||
| if (!_siloStatusOracle.CurrentStatus.IsTerminating()) | ||||||||
| if (_siloStatusOracle.CurrentStatus == SiloStatus.Active) | ||||||||
| { | ||||||||
| var address = new GrainAddress | ||||||||
| { | ||||||||
|
|
@@ -161,10 +161,11 @@ public IGrainContext GetOrCreateActivation( | |||||||
| static IGrainContext UnableToCreateActivation(Catalog self, GrainId grainId) | ||||||||
| { | ||||||||
| // Did not find and did not start placing new | ||||||||
| var isTerminating = self._siloStatusOracle.CurrentStatus.IsTerminating(); | ||||||||
| if (isTerminating) | ||||||||
| var status = self._siloStatusOracle.CurrentStatus; | ||||||||
| var isTerminating = status.IsTerminating(); | ||||||||
| if (status is not SiloStatus.Active) | ||||||||
| { | ||||||||
| self.LogDebugUnableToCreateActivationTerminating(grainId); | ||||||||
| self.LogDebugUnableToCreateActivationWhenNotActive(grainId); | ||||||||
| } | ||||||||
| else | ||||||||
| { | ||||||||
|
|
@@ -391,10 +392,9 @@ private readonly struct SiloAddressLogValue(SiloAddress silo) | |||||||
| private partial void LogDebugDeactivateAllActivations(); | ||||||||
|
|
||||||||
| [LoggerMessage( | ||||||||
|
||||||||
| [LoggerMessage( | |
| [LoggerMessage( | |
| EventId = (int)ErrorCode.Catalog_SiloNotActive, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The variable
isTerminatingis assigned on line 165 but is no longer used within theifblock on lines 166-169. It's only used later on line 179. Consider moving the assignment closer to where it's used, or if it's intentionally kept here for clarity, this is fine but could be optimized.