File tree Expand file tree Collapse file tree 1 file changed +21
-12
lines changed Expand file tree Collapse file tree 1 file changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -279,29 +279,38 @@ private async Task ExecuteAsync()
279
279
continue ;
280
280
}
281
281
282
- try
282
+ if ( _preferInlineScheduling )
283
283
{
284
- if ( _preferInlineScheduling )
284
+ try
285
285
{
286
286
await requestContext . ExecuteAsync ( ) ;
287
287
}
288
- else
288
+ catch ( Exception ex )
289
+ {
290
+ // Request processing failed
291
+ // Log the error message, release throttle and move on
292
+ Log . RequestListenerProcessError ( _messagePump . _logger , ex ) ;
293
+ }
294
+ }
295
+ else
296
+ {
297
+ try
289
298
{
290
299
// Queue another accept before we execute the request
291
300
ThreadPool . UnsafeQueueUserWorkItem ( this , preferLocal : false ) ;
292
301
293
302
// Use this thread to start the execution of the request (avoid the double threadpool dispatch)
294
303
await requestContext . ExecuteAsync ( ) ;
295
-
296
- // We're done with this thread
297
- return ;
298
304
}
299
- }
300
- catch ( Exception ex )
301
- {
302
- // Request processing failed
303
- // Log the error message, release throttle and move on
304
- Log . RequestListenerProcessError ( _messagePump . _logger , ex ) ;
305
+ catch ( Exception ex )
306
+ {
307
+ // Request processing failed
308
+ // Log the error message, release throttle and move on
309
+ Log . RequestListenerProcessError ( _messagePump . _logger , ex ) ;
310
+ }
311
+
312
+ // We're done with this thread, accept loop was continued via ThreadPool.UnsafeQueueUserWorkItem
313
+ return ;
305
314
}
306
315
}
307
316
You can’t perform that action at this time.
0 commit comments