我一直在使用WCF开发Silverlight应用程序.
问题是有时会引发异常,说明:
"对'http:// localhost:1276/Foo.svc'的HTTP请求已超过分配的超时.分配给此操作的时间可能是较长超时的一部分."
那么我该如何增加时间跨度?有些人建议在web配置和service.client配置文件中使用接收时间,如下所示
<bindings>
<customBinding >
<binding name="customBinding0" receiveTimeout="02:00:00" >
<binaryMessageEncoding maxReadPoolSize="2147483647" maxWritePoolSize="2147483647" maxSessionSize="2147483647" />
<httpTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Buffered"/>
</binding>
</customBinding>
</bindings>
Run Code Online (Sandbox Code Playgroud)
receiveTimeout属性的最大值是多少?
我正在使用第三方Java库与REST API进行交互.REST API有时需要很长时间才能响应,最终导致java.net.ConnectException被抛出.
我想缩短超时时间,但无法修改第三方库.
我想在调用Java方法时应用某种形式的超时控制,以便我可以确定在什么时候放弃等待.
这与网络超时无直接关系.我希望能够尝试执行操作,并能够在指定的等待时间后放弃.
以下绝不是有效的Java,但在概念上证明了我想要实现的目标:
try {
Entity entity = new Entity();
entity.methodThatMakesUseOfRestApi();
} catch (<it's been ages now, I don't want to wait any longer>) {
throw TimeoutException();
}
Run Code Online (Sandbox Code Playgroud) 它与任何版本无关,只是想知道如何更改(当然增加)Squirrel Sql Client的会话超时值.因为我真的很无聊得到一些异常"发送到服务器的最后一个数据包是..之前"
任何帮助,将不胜感激.
我在函数内部调用外部程序.现在我想超时这个功能而不仅仅是外部程序.但是在函数超时之后,外部程序仍然在我的计算机上运行(我正在使用debian),直到它完成计算,之后它的线程仍然作为主程序的子线程保留在进程表中直到主程序终止.
这里有两个最小的例子,说明了我想做的事情.第一个使用unsafePerformIO,第二个完全在IO monad中.我并不真的依赖于unsafePerformIO,但是如果可能的话我想保留它.所描述的问题在有和没有它的情况下发生.
module Main where
import System.Timeout
import Criterion.Measurement
import System.IO.Unsafe
import System.Process
main = do
x <- time $ timeoutP (1 * 1000000) $ mytest 2
y <- getLine
putStrLn $ show x ++ y
timeoutP :: Int -> a -> IO (Maybe a)
timeoutP t fun = timeout t $ return $! fun
mytest :: Int -> String
mytest n =
let
x = runOnExternalProgram $ n * 1000
in
x ++ ". Indeed."
runOnExternalProgram :: …Run Code Online (Sandbox Code Playgroud) 我正在处理一个糟糕的ISP,它在我的脚本运行时在随机点重置我的WAN连接.我希望转移能够在重置后继续存在并继续.我手动启动此脚本vs目前使用cron/launchd.
我有一个相当基本的脚本,如下所示:
rsync -rltv --progress --partial -e "ssh -i <key> -o ConnectTimeout=300" <remotedir> <localdir>
Run Code Online (Sandbox Code Playgroud)
我最好把延迟放在rsync部分吗?
例如:
rsync -rltv --progress--partial --timeout=300 -e "ssh -i <key>" <remotedir> <localdir>
Run Code Online (Sandbox Code Playgroud)
谢谢!
我有一个闪亮的应用程序,允许用户上传自己的数据,并做一些任务.根据他们的数据大小和他们希望执行的任务类型,有时这个过程会变得很长甚至持久.我想添加"停止"功能,用户可以在其中单击它,当前任务将停止,他们可以继续执行其他任务.我该怎么办?
我的第二个问题与第一个问题有关.假设我的一个应用程序用户已经部署了一个非常繁重的进程并且它占用了我的CPU,但是用户自己还没有启动停止信号.我想强加一个"超时"命令,以便应用程序在5分钟后自动终止.我该如何设置?
致以真诚的感谢和诚挚的问候,
多云的
我想知道如何在symfony中增加会话超时.仅调整symfony配置设置还是我还必须在php.ini文件中配置任何内容?
我试图使用concurrent.futures模块在python3.2中使用超时.但是当它超时时,它并没有真正停止执行.我尝试了两个线程和进程池执行程序,它们都没有停止任务,只有在完成后才会引发超时.那么有谁知道它是否有可能使这个工作?
import concurrent.futures
import time
import datetime
max_numbers = [10000000, 10000000, 10000000, 10000000, 10000000]
def run_loop(max_number):
print("Started:", datetime.datetime.now(), max_number)
last_number = 0;
for i in range(1, max_number + 1):
last_number = i * i
return last_number
def main():
with concurrent.futures.ProcessPoolExecutor(max_workers=len(max_numbers)) as executor:
try:
for future in concurrent.futures.as_completed(executor.map(run_loop, max_numbers, timeout=1), timeout=1):
print(future.result(timeout=1))
except concurrent.futures._base.TimeoutError:
print("This took to long...")
if __name__ == '__main__':
main()
Run Code Online (Sandbox Code Playgroud) 生产环境在Azure上,使用Redis Cache Standard 2.5GB.
例1
System.Web.HttpUnhandledException(0X80004005):类型System.Web.HttpUnhandledException'引发的异常.---> StackExchange.Redis.RedisTimeoutException:超时执行SETNX User.313123,inst:49,mgr:无效,错误:从不,队列:0,qu:0,qs:0,qc:0,wr:0,wq :0,in:0,ar:0,clientName:PRD-VM-WEB-2,serverEndpoint:Unspecified/Construct3.redis.cache.windows.net:6380,keyHashSlot:15649,IOCP:(Busy = 0,Free = 1000,Min = 1,Max = 1000),WORKER :( Busy = 1,Free = 32766,Min = 1,Max = 32767)(请查看本文,了解可能导致超时的一些常见客户端问题: http://stackexchange.github.io/StackExchange.Redis/Timeouts)在StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl [T](消息消息,ResultProcessor
1 processor, ServerEndPoint server) in c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\ConnectionMultiplexer.cs:line 2120 at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor在C 1级的处理器,ServerEndPoint服务器):\代码\ StackExchange.Redis\StackExchange. Redis\StackExchange\Redis\RedisBase.cs:第81行
例2
StackExchange.Redis.RedisTimeoutException:超时执行GET ForumTopic.33831,inst:1,mgr:无效,错误:从不,队列:2,qu:0,qs:2,qc:0,wr:0,wq:0,in :0,ar:0,clientName:PRD-VM-WEB-2,serverEndpoint:Unspecified/Construct3.redis.cache.windows.net:6380,keyHashSlot:5851,IOCP:(Buzy = 0,Free = 1000,Min = 1,Max = 1000),WORKER :( Busy = 1,Free = 32766,Min = 1,Max = 32767)(请查看本文,了解一些可能导致超时的常见客户端问题: http:// stackexchange.github.io/StackExchange.Redis/Timeouts)在StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl [T](消息消息,ResultProcessor
1 processor, ServerEndPoint server) in c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\ConnectionMultiplexer.cs:line 2120 …
timeout ×10
python ×2
session ×2
azure ×1
concurrency ×1
haskell ×1
java ×1
mechanize ×1
python-3.x ×1
r ×1
redis ×1
rsync ×1
shiny ×1
silverlight ×1
squirrel-sql ×1
ssh ×1
symfony ×1
symfony1 ×1
terminate ×1
wcf ×1