@@ -144,7 +144,7 @@ public void FirstPoolUsage(SemaphoreSlim semaphore)
144144 public async Task FirstPoolUsageAsync ( SemaphoreSlim semaphore )
145145 {
146146 if ( ! this . FirstPoolUsageNeedsSniffing ) return ;
147- var success = await semaphore . WaitAsync ( this . _settings . RequestTimeout , this . _cancellationToken ) ;
147+ var success = await semaphore . WaitAsync ( this . _settings . RequestTimeout , this . _cancellationToken ) . ConfigureAwait ( false ) ;
148148 if ( ! success )
149149 throw new PipelineException ( PipelineFailure . CouldNotStartSniffOnStartup , ( Exception ) null ) ;
150150
@@ -153,7 +153,7 @@ public async Task FirstPoolUsageAsync(SemaphoreSlim semaphore)
153153 {
154154 using ( this . Audit ( SniffOnStartup ) )
155155 {
156- await this . SniffAsync ( ) ;
156+ await this . SniffAsync ( ) . ConfigureAwait ( false ) ;
157157 this . _connectionPool . SniffedOnStartup = true ;
158158 }
159159 }
@@ -178,7 +178,7 @@ public async Task SniffOnStaleClusterAsync()
178178 if ( ! StaleClusterState ) return ;
179179 using ( this . Audit ( AuditEvent . SniffOnStaleCluster ) )
180180 {
181- await this . SniffAsync ( ) ;
181+ await this . SniffAsync ( ) . ConfigureAwait ( false ) ;
182182 this . _connectionPool . SniffedOnStartup = true ;
183183 }
184184 }
@@ -263,7 +263,7 @@ public async Task PingAsync(Node node)
263263 try
264264 {
265265 var pingData = CreatePingRequestData ( node , audit ) ;
266- var response = await this . _connection . RequestAsync < VoidResponse > ( pingData ) ;
266+ var response = await this . _connection . RequestAsync < VoidResponse > ( pingData ) . ConfigureAwait ( false ) ;
267267 ThrowBadAuthPipelineExceptionWhenNeeded ( response ) ;
268268 //ping should not silently accept bad but valid http responses
269269 if ( ! response . Success ) throw new PipelineException ( PipelineFailure . BadResponse ) ;
@@ -301,7 +301,7 @@ public async Task SniffOnConnectionFailureAsync()
301301 {
302302 if ( ! this . SniffsOnConnectionFailure ) return ;
303303 using ( this . Audit ( SniffOnFail ) )
304- await this . SniffAsync ( ) ;
304+ await this . SniffAsync ( ) . ConfigureAwait ( false ) ;
305305 }
306306
307307 public void Sniff ( )
@@ -349,7 +349,7 @@ public async Task SniffAsync()
349349 try
350350 {
351351 var requestData = new RequestData ( HttpMethod . GET , path , null , this . _settings , this . _memoryStreamFactory ) { Node = node } ;
352- var response = await this . _connection . RequestAsync < SniffResponse > ( requestData ) ;
352+ var response = await this . _connection . RequestAsync < SniffResponse > ( requestData ) . ConfigureAwait ( false ) ;
353353 ThrowBadAuthPipelineExceptionWhenNeeded ( response ) ;
354354 //sniff should not silently accept bad but valid http responses
355355 if ( ! response . Success ) throw new PipelineException ( PipelineFailure . BadResponse ) ;
@@ -406,7 +406,7 @@ public async Task<ElasticsearchResponse<TReturn>> CallElasticsearchAsync<TReturn
406406 ElasticsearchResponse < TReturn > response = null ;
407407 try
408408 {
409- response = await this . _connection . RequestAsync < TReturn > ( requestData ) ;
409+ response = await this . _connection . RequestAsync < TReturn > ( requestData ) . ConfigureAwait ( false ) ;
410410 response . AuditTrail = this . AuditTrail ;
411411 ThrowBadAuthPipelineExceptionWhenNeeded ( response ) ;
412412 if ( ! response . Success ) audit . Event = AuditEvent . BadResponse ;
0 commit comments