Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Orleans.Runtime/Catalog/Catalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public IGrainContext GetOrCreateActivation(
return result;
}

if (!_siloStatusOracle.CurrentStatus.IsTerminating())
if (_siloStatusOracle.CurrentStatus == SiloStatus.Active)
{
var address = new GrainAddress
{
Expand Down Expand Up @@ -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();

Copilot AI Nov 17, 2025

Copy link

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.
if (status is not SiloStatus.Active)
{
self.LogDebugUnableToCreateActivationTerminating(grainId);
self.LogDebugUnableToCreateActivationWhenNotActive(grainId);
}
else
{
Expand Down Expand Up @@ -391,10 +392,9 @@ private readonly struct SiloAddressLogValue(SiloAddress silo)
private partial void LogDebugDeactivateAllActivations();

[LoggerMessage(

Copilot AI Nov 17, 2025

Copy link

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.
EventId = (int)ErrorCode.CatalogNonExistingActivation2,
Level = LogLevel.Debug,
Message = "Unable to create activation for grain {GrainId} because this silo is terminating")]
private partial void LogDebugUnableToCreateActivationTerminating(GrainId grainId);
Message = "Unable to create activation for grain {GrainId} because this silo is not active.")]
private partial void LogDebugUnableToCreateActivationWhenNotActive(GrainId grainId);

[LoggerMessage(
EventId = (int)ErrorCode.CatalogNonExistingActivation2,
Expand Down
Loading