由于一台服务器而非另一台服务器上的堆栈溢出错误,该进程被终止
当我们的 Web 服务在特定服务器上调用而不是在另一台服务器上调用时,我们会收到上述错误。这是使用的代码...
foreach (Service service in serviceSetup.Services)
{
if (service.CallService == true)
{
serviceConfig = ServiceConfigurationFactory.CreateConfiguration(service.Name, service.URL);
aSyncRequest = new ASyncRequest(serviceConfig.GetEnrichmentXML);
IAsyncResult res = aSyncRequest.BeginInvoke(request, null, null);
results.Add(res);
waitHandles.Add(res.AsyncWaitHandle);
}
}
bool terminExists = false;
if (waitHandles.Count > 0)
{
WaitHandle.WaitAll(waitHandles.ToArray(), Convert.ToInt32(Utils.AppSetting("ServiceWaitTime")));
foreach (IAsyncResult res in results)
{
if (res.IsCompleted)
{
try
{
returnEnrichmentXML = aSyncRequest.EndInvoke(res);
if (!string.IsNullOrEmpty(returnEnrichmentXML.ABIQ))
{
//need to see if we insert or concat the return enriched data as skinny can be done locally in electRa
//prior to QuotesHub
int index = enrichmentXML.ABIQ.IndexOf("99TERMIN|");
if (index > -1)
{
enrichmentXML.ABIQ = enrichmentXML.ABIQ.Insert(index, returnEnrichmentXML.ABIQ);
terminExists = true;
}
else
{
enrichmentXML.ABIQ = string.Concat(enrichmentXML.ABIQ, returnEnrichmentXML.ABIQ);
enrichmentABIQAdded = true;
}
}
if (!string.IsNullOrEmpty(returnEnrichmentXML.FullResults))
{
enrichmentXML.FullResults = string.Concat(enrichmentXML.FullResults, returnEnrichmentXML.FullResults);
}
}
catch (Exception ex)
{
ExceptionHandler.HandleException(ex);
throw ex;
}
}
}
}
不,我只是想我可能不会对未完成的结果调用 EndInvoke。所以我认为 .NET 会将其存储在内存中,直到 GC 将其清除。我不认为这会导致堆栈溢出问题。
即使只进行一次异步调用,我们也会遇到这个问题。我也不是一名大型服务器专家,但是它正在运行的服务器比它没有运行的服务器差很多。
有什么想法吗?
干杯
we are getting the above error when our web service is called on a particular server but not on another. Here is the code that is used....
foreach (Service service in serviceSetup.Services)
{
if (service.CallService == true)
{
serviceConfig = ServiceConfigurationFactory.CreateConfiguration(service.Name, service.URL);
aSyncRequest = new ASyncRequest(serviceConfig.GetEnrichmentXML);
IAsyncResult res = aSyncRequest.BeginInvoke(request, null, null);
results.Add(res);
waitHandles.Add(res.AsyncWaitHandle);
}
}
bool terminExists = false;
if (waitHandles.Count > 0)
{
WaitHandle.WaitAll(waitHandles.ToArray(), Convert.ToInt32(Utils.AppSetting("ServiceWaitTime")));
foreach (IAsyncResult res in results)
{
if (res.IsCompleted)
{
try
{
returnEnrichmentXML = aSyncRequest.EndInvoke(res);
if (!string.IsNullOrEmpty(returnEnrichmentXML.ABIQ))
{
//need to see if we insert or concat the return enriched data as skinny can be done locally in electRa
//prior to QuotesHub
int index = enrichmentXML.ABIQ.IndexOf("99TERMIN|");
if (index > -1)
{
enrichmentXML.ABIQ = enrichmentXML.ABIQ.Insert(index, returnEnrichmentXML.ABIQ);
terminExists = true;
}
else
{
enrichmentXML.ABIQ = string.Concat(enrichmentXML.ABIQ, returnEnrichmentXML.ABIQ);
enrichmentABIQAdded = true;
}
}
if (!string.IsNullOrEmpty(returnEnrichmentXML.FullResults))
{
enrichmentXML.FullResults = string.Concat(enrichmentXML.FullResults, returnEnrichmentXML.FullResults);
}
}
catch (Exception ex)
{
ExceptionHandler.HandleException(ex);
throw ex;
}
}
}
}
No i have just thought that i may not be calling EndInvoke on results that are not completed. So i presume .NET would store this in memory until the GC would clear it up. I don't think this would cause a stack overflow issue though.
We also get the issue even if just one asynchronous call is made. I'm not a massive server expert either, but the server it is working on is a lot worse than the one it isn't working on.
Any ideas??
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论