我要求从asp.net核心网站制作的Web服务在开发者机器上超时(在生产中它们工作正常)。 具体来说,第一个请求几乎总是超时,但是在它倾向于成功后立即生成。
在日志中出现以下错误:
{
"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)
...
在本地启动的不同Web服务器(kestrel,iis express,iis)中,此行为是相同的,但在生产中(在单声道docker容器中)没有这样的问题。
非常感谢任何帮助!