简体   繁体   English

使用WCF服务的Timout

[英]Timout with wcf service

I have a serious timeout issue with a wcf service. wcf服务存在严重的超时问题。 I will explain the situation: I have a asp.net that calls wcf service, The wcf service creates a new thread, The new thread creates a process that runs a python script. 我将说明这种情况:我有一个调用wcf服务的asp.net,wcf服务创建了一个新线程,新线程创建了一个运行python脚本的进程。

Note: The website does not wait for the python script to end, it only gets a confirmation the script is running:-). 注意:网站不等待python脚本结束,它仅会确认脚本正在运行:-)。

The python script is created by creating a new process and calling Waitforexit(). 通过创建新进程并调用Waitforexit()来创建python脚本。 The script is a very long script that takes about 5 hours, after about 2 hours the WaitForExit method throws a exception saying "Thread was being aborted". 该脚本是一个非常长的脚本,大约需要5个小时,大约2个小时后,WaitForExit方法将引发异常,指出“线程正在中止”。

I am battling for more than a week with this and I am really clueless. 我为此奋斗了一个多星期,我真的很笨。 I will be really happy getting some help, I am m sorry in advance if this post is not formatted nicely, it was written by mobile. 我会很高兴获得帮助,如果对此帖子的格式不好,请事先对不起,它是用手机编写的。

Thanks a lot. 非常感谢。

I remember having a similar problem. 我记得有类似的问题。 The web service application stops after a period of inactivity, so the thread will abort. Web服务应用程序在一段时间不活动后停止,因此线程将中止。

One way to get around it is to have a Windows service call the web service every 10 seconds or so, or better, have the Windows service pick up the "Job" using a database queue or other similar technique. 解决该问题的一种方法是让Windows服务每10秒钟左右调用一次Web服务,或者更好的方法是让Windows服务使用数据库队列或其他类似技术来拾取“作业”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM