Skip to content
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

TimingPipeFlusher.FlushAsync Kestrel exception running inside Aspire with Orleans #60825

Open
1 task done
joshcornejo opened this issue Mar 8, 2025 · 2 comments
Open
1 task done
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Comments

@joshcornejo
Copy link

joshcornejo commented Mar 8, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have many controllers running inside a DLL, one particular controller uses Orleans and persists to Redis.

I keep getting FlushAsync exceptions only in API calls that involve Orleans, but these exceptions happen before it reaches the call to my code (somewhere inside the controller).

The methods all work - but now are 95% slower as several of the same exceptions are also raised when I try to access the Orleans' grains.

Any ideas?

My Aspire Program.cs:

    var orleans_cache = builder.AddRedis("orleans-redis")
                               .WithRedisInsight();
    var orleans = builder.AddOrleans("orleans-grains")
                         .WithGrainStorage("orleans-cache", orleans_cache)
                         .WithClustering(orleans_cache);

My Program.cs:

  builder.AddKeyedRedisDistributedCache("orleans-redis");
   builder.AddKeyedRedisClient("orleans-cache");

My grain constructor:

    public World([PersistentState("orleans-redis", "orleans-cache")] IPersistentState<Context> context)
    {
        this.context = context;
    }

message.txt

Expected Behavior

No exceptions

Exceptions (if any)

Attached

.NET Version

9.0.100-rc.2.24474.11

Anything else?

Nothing

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Mar 8, 2025
@BrennanConroy
Copy link
Member

Relevant part of the exception:

System.IO.IOException: The encryption operation failed, see inner exception.
---> System.ComponentModel.Win32Exception (14): Bad address
--- End of inner exception stack trace ---
at System.Net.Security.SslStream.WriteSingleChunk[TIOAdapter](ReadOnlyMemory1 buffer, CancellationToken cancellationToken) at System.Net.Security.SslStream.WriteAsyncInternal[TIOAdapter](ReadOnlyMemory1 buffer, CancellationToken cancellationToken)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.Net.Security.SslStream.WriteAsync(ReadOnlyMemory`1 buffer, CancellationToken cancellationToken)

Seems like you've configured something wrong, don't think this is anything to do with Kestrel.

@joshcornejo
Copy link
Author

@BrennanConroy - everything should have been configured by Aspire. This exception started when I was changing the Orleans constructor to persist the grains, and I have no clue WHAT is clashing where (as the exception stacks are not pointing me in any direction).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

No branches or pull requests

2 participants