Запрашивать тайм-аут канала при обращении к веб-сервисам под ядром asp.net

У меня есть запросы к веб-службам, сделанным из основного веб-сайта asp.net, на тайм-аут машины (в работе они работают нормально). В частности, первый запрос почти всегда истекает, но тот, который сделан сразу после его выполнения, имеет тенденцию к успеху.

В логах возникает следующая ошибка:

{
  "Message": "The request channel timed out attempting to send after 00:01:00. I
ncrease the timeout value passed to the call to Request or increase the SendTime
out value on the Binding. The time allotted to this operation may have been a po
rtion of a longer timeout.",
  "Data": {},
  "InnerException": {
    "Message": "The HTTP request to '<service address here>' has exceeded the allotted timeout of 00:01:00. The time allotted to this
operation may have been a portion of a longer timeout.",
    "Data": {},
    "StackTrace": "   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpC
lientRequestChannel.HttpClientChannelAsyncRequest.<SendRequestAsync>d__13.MoveNe
xt()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
ification(Task task)
   at System.ServiceModel.Channels.RequestChannel.<RequestAsync>d__35.MoveNext()
",
    "Source": "System.Private.ServiceModel",
    "HResult": -2146233083
  },
  "StackTrace": "   at System.ServiceModel.Channels.RequestChannel.<RequestAsync
>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
ification(Task task)
   at System.ServiceModel.Channels.RequestChannel.<RequestAsyncInternal>d__34.Mo
veNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
ification(Task task)
   at System.Runtime.TaskHelpers.WaitForCompletionNoSpin[TResult](Task`1 task)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeS
pan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message messag
e, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on
eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan tim
eout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(MethodCall
methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(MethodInfo targetM
ethod, Object[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Reflection.DispatchProxyGenerator.Invoke(Object[] args)
...

Это поведение одинаково на разных веб-серверах, запущенных локально (kestrel, iis express, iis), но в производственной среде (в моноконтейнерном контейнере) такой проблемы нет.

Любая помощь высоко ценится!

0 ответов

Другие вопросы по тегам