diff --git a/Microsoft.DurableTask.sln b/Microsoft.DurableTask.sln index 795992c8..9336d084 100644 --- a/Microsoft.DurableTask.sln +++ b/Microsoft.DurableTask.sln @@ -113,39 +113,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DistributedTracingSample", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReplaySafeLoggerFactorySample", "samples\ReplaySafeLoggerFactorySample\ReplaySafeLoggerFactorySample.csproj", "{8E7BECBC-7226-4778-B8F2-8EBDFF0D3BA4}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Grpc", "Grpc", "{51A52603-541D-DE3F-2825-C80F9EE6C532}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AzureManaged", "AzureManaged", "{D4587EC0-1B16-8420-7502-A967139249D4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Grpc", "Grpc", "{3B8F957E-7773-4C0C-ACD7-91A1591D9312}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AzureManaged", "AzureManaged", "{53193780-CD18-2643-6953-C26F59EAEDF5}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {B12489CB-B7E5-497B-8F0C-F87F678947C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B12489CB-B7E5-497B-8F0C-F87F678947C3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B12489CB-B7E5-497B-8F0C-F87F678947C3}.Debug|x64.ActiveCfg = Debug|Any CPU - {B12489CB-B7E5-497B-8F0C-F87F678947C3}.Debug|x64.Build.0 = Debug|Any CPU - {B12489CB-B7E5-497B-8F0C-F87F678947C3}.Debug|x86.ActiveCfg = Debug|Any CPU - {B12489CB-B7E5-497B-8F0C-F87F678947C3}.Debug|x86.Build.0 = Debug|Any CPU {B12489CB-B7E5-497B-8F0C-F87F678947C3}.Release|Any CPU.ActiveCfg = Release|Any CPU {B12489CB-B7E5-497B-8F0C-F87F678947C3}.Release|Any CPU.Build.0 = Release|Any CPU - {B12489CB-B7E5-497B-8F0C-F87F678947C3}.Release|x64.ActiveCfg = Release|Any CPU - {B12489CB-B7E5-497B-8F0C-F87F678947C3}.Release|x64.Build.0 = Release|Any CPU - {B12489CB-B7E5-497B-8F0C-F87F678947C3}.Release|x86.ActiveCfg = Release|Any CPU - {B12489CB-B7E5-497B-8F0C-F87F678947C3}.Release|x86.Build.0 = Release|Any CPU {B0EB48BE-E4F7-4F50-B8BD-5C6172A7A584}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B0EB48BE-E4F7-4F50-B8BD-5C6172A7A584}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B0EB48BE-E4F7-4F50-B8BD-5C6172A7A584}.Debug|x64.ActiveCfg = Debug|Any CPU {B0EB48BE-E4F7-4F50-B8BD-5C6172A7A584}.Debug|x64.Build.0 = Debug|Any CPU {B0EB48BE-E4F7-4F50-B8BD-5C6172A7A584}.Debug|x86.ActiveCfg = Debug|Any CPU {B0EB48BE-E4F7-4F50-B8BD-5C6172A7A584}.Debug|x86.Build.0 = Debug|Any CPU @@ -751,10 +730,6 @@ Global {05C9EBA6-7221-D458-47D6-DA457C2F893B} = {E5637F81-2FB9-4CD7-900D-455363B142A7} {4A7305AE-AAAE-43AE-AAB2-DA58DACC6FA8} = {EFF7632B-821E-4CFC-B4A0-ED4B24296B17} {8E7BECBC-7226-4778-B8F2-8EBDFF0D3BA4} = {EFF7632B-821E-4CFC-B4A0-ED4B24296B17} - {51A52603-541D-DE3F-2825-C80F9EE6C532} = {1C217BB2-CE16-41CC-9D47-0FC0DB60BDB3} - {D4587EC0-1B16-8420-7502-A967139249D4} = {1C217BB2-CE16-41CC-9D47-0FC0DB60BDB3} - {3B8F957E-7773-4C0C-ACD7-91A1591D9312} = {5B448FF6-EC42-491D-A22E-1DC8B618E6D5} - {53193780-CD18-2643-6953-C26F59EAEDF5} = {5B448FF6-EC42-491D-A22E-1DC8B618E6D5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {AB41CB55-35EA-4986-A522-387AB3402E71} diff --git a/samples/ReplaySafeLoggerFactorySample/Program.cs b/samples/ReplaySafeLoggerFactorySample/Program.cs index 09c8ecdb..6ee494b4 100644 --- a/samples/ReplaySafeLoggerFactorySample/Program.cs +++ b/samples/ReplaySafeLoggerFactorySample/Program.cs @@ -187,7 +187,6 @@ public async Task CallActivityWithLoggingAsync( } public override T GetInput() - where T : default => this.innerContext.GetInput()!; public override Task CallActivityAsync( diff --git a/src/Abstractions/TaskOrchestrationContext.cs b/src/Abstractions/TaskOrchestrationContext.cs index fbd2741d..49a1e6b0 100644 --- a/src/Abstractions/TaskOrchestrationContext.cs +++ b/src/Abstractions/TaskOrchestrationContext.cs @@ -479,7 +479,7 @@ ILoggerFactory GetUnwrappedLoggerFactory() if (++depth > 10) { throw new InvalidOperationException( - "Cycle detected while unwrapping ReplaySafeLoggerFactory. " + + "Maximum unwrap depth exceeded while resolving the underlying ILoggerFactory. " + "Ensure the wrapper's LoggerFactory property delegates to the inner context's " + "ReplaySafeLoggerFactory (e.g., 'inner.ReplaySafeLoggerFactory'), not 'this.ReplaySafeLoggerFactory'."); } diff --git a/test/Abstractions.Tests/TaskOrchestrationContextReplaySafeLoggerFactoryTests.cs b/test/Abstractions.Tests/TaskOrchestrationContextReplaySafeLoggerFactoryTests.cs index bdb7c0ea..449840c1 100644 --- a/test/Abstractions.Tests/TaskOrchestrationContextReplaySafeLoggerFactoryTests.cs +++ b/test/Abstractions.Tests/TaskOrchestrationContextReplaySafeLoggerFactoryTests.cs @@ -108,7 +108,7 @@ public void ReplaySafeLoggerFactory_CreateLogger_ThrowsOnCyclicLoggerFactory() // Assert act.Should().Throw() - .WithMessage("*Cycle detected*"); + .WithMessage("*Maximum unwrap depth exceeded*"); } [Fact] @@ -161,7 +161,6 @@ public override bool IsReplaying protected override ILoggerFactory LoggerFactory => this.loggerFactory; public override T GetInput() - where T : default => default!; public override Task CallActivityAsync(TaskName name, object? input = null, TaskOptions? options = null) @@ -218,7 +217,6 @@ public WrappingTaskOrchestrationContext(TaskOrchestrationContext innerContext) protected override ILoggerFactory LoggerFactory => this.innerContext.ReplaySafeLoggerFactory; public override T GetInput() - where T : default => this.innerContext.GetInput()!; public override Task CallActivityAsync(TaskName name, object? input = null, TaskOptions? options = null) @@ -274,7 +272,6 @@ public SelfReferencingContext(ILoggerFactory loggerFactory) protected override ILoggerFactory LoggerFactory => this.ReplaySafeLoggerFactory; public override T GetInput() - where T : default => default!; public override Task CallActivityAsync(TaskName name, object? input = null, TaskOptions? options = null)