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

Redis, async all the way through #258

Merged
merged 1 commit into from
Aug 31, 2019
Merged

Redis, async all the way through #258

merged 1 commit into from
Aug 31, 2019

Conversation

Beffyman
Copy link
Contributor

This will avoid the potential thread block from the synchronous Connect & Ping.
Tools like Ben.BlockingDetector output the following:

warn: Ben.Diagnostics.BlockingMonitor[6]
     Blocking method has been invoked and blocked, this can lead to threadpool starvation.
        at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
        at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout)
        at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(Object configuration, TextWriter log)
        at StackExchange.Redis.ConnectionMultiplexer.Connect(String configuration, TextWriter log)
        at HealthChecks.Redis.RedisHealthCheck.CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken)
        at Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService.CheckHealthAsync(Func`2 predicate, CancellationToken cancellationToken)
        at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
        at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
        at Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService.CheckHealthAsync(Func`2 predicate, CancellationToken cancellationToken)
        at Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckService.CheckHealthAsync(CancellationToken cancellationToken)
        at ...

This will avoid the thread block from the synchronous Connect call and Ping
@Beffyman Beffyman marked this pull request as ready for review August 27, 2019 21:25
@unaizorrilla unaizorrilla merged commit e268e75 into Xabaril:master Aug 31, 2019
@unaizorrilla
Copy link
Collaborator

Hi @Beffyman

Merged!! Thanks for contribute to this project!

@sungam3r sungam3r mentioned this pull request Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants