Skip to content

Disallow creating a grain activation before a silo is active#9612

Merged
ReubenBond merged 1 commit intodotnet:mainfrom
ReubenBond:fix/only-allow-activations-when-active
Nov 18, 2025
Merged

Disallow creating a grain activation before a silo is active#9612
ReubenBond merged 1 commit intodotnet:mainfrom
ReubenBond:fix/only-allow-activations-when-active

Conversation

@ReubenBond
Copy link
Member

@ReubenBond ReubenBond commented Jul 16, 2025

Opening to run tests in CI. I expect tests to fail

Microsoft Reviewers: Open in CodeFlow

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR strengthens the grain activation creation logic by restricting it to only occur when the silo is in the Active state, rather than just checking if it's not terminating. This ensures grain activations cannot be created during intermediate states like Created or Joining.

Key Changes:

  • Modified the condition for allowing grain activation creation from !IsTerminating() to explicitly checking for SiloStatus.Active
  • Updated error handling to reflect the new constraint, checking for not SiloStatus.Active instead of just terminating states
  • Renamed and updated the logging method to reflect the broader condition

var isTerminating = self._siloStatusOracle.CurrentStatus.IsTerminating();
if (isTerminating)
var status = self._siloStatusOracle.CurrentStatus;
var isTerminating = status.IsTerminating();
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The variable isTerminating is assigned on line 165 but is no longer used within the if block 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.

Copilot uses AI. Check for mistakes.
@@ -391,10 +392,9 @@ private readonly struct SiloAddressLogValue(SiloAddress silo)
private partial void LogDebugDeactivateAllActivations();

[LoggerMessage(
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new log method LogDebugUnableToCreateActivationWhenNotActive is missing an EventId attribute, while the similar method LogDebugUnableToCreateActivation on line 400 has EventId = (int)ErrorCode.CatalogNonExistingActivation2. Consider adding an appropriate EventId for consistency and to aid in log analysis.

Suggested change
[LoggerMessage(
[LoggerMessage(
EventId = (int)ErrorCode.Catalog_SiloNotActive,

Copilot uses AI. Check for mistakes.
Merged via the queue into dotnet:main with commit c0a9fcf Nov 18, 2025
34 checks passed
@ReubenBond ReubenBond deleted the fix/only-allow-activations-when-active branch November 18, 2025 00:17
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments