timeout

Ruby Timeout::timeout doesn't fire Exception and doesn't return what documented

人走茶凉 提交于 2019-12-21 04:01:32
问题 i have this piece of code: begin complete_results = Timeout.timeout(4) do results = platform.search(artist, album_name) end rescue Timeout::Error puts 'Print me something please' end I then launch the method containing this code, and well, here is the beginning of a stack trace: Exception message : execution expired Exception backtrace : /***/****/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/timeout.rb:64:i So i naively thinks that my call timeouted. But 'Print me something please' is never

Implement c# timeout

大兔子大兔子 提交于 2019-12-20 23:23:39
问题 Is it bad practice to use such while loop? Maybe it is better to use Stopwatch, or maybe this solution has some pitfalls? public void DoWork() { //do some preparation DateTime startTime = DateTime.Now; int rowsCount = 0; int finalCount = getFinalCount(); do { Thread.Sleep(1000); rowsCount = getRowsCount(); // gets rows count from database, rows are added by external app. } while (rowsCount < finalCount && DateTime.Now - startTime < TimeSpan.FromMinutes(10)); } I saw this article Implement C#

Google App Engine timeout: The datastore operation timed out, or the data was temporarily unavailable

我怕爱的太早我们不能终老 提交于 2019-12-20 20:36:54
问题 This is a common exception I'm getting on my application's log daily, usually 5/6 times a day with a traffic of 1K visits/day: db error trying to store stats Traceback (most recent call last): File "/base/data/home/apps/stackprinter/1b.347728306076327132/app/utility/worker.py", line 36, in deferred_store_print_statistics dbcounter.increment() File "/base/data/home/apps/stackprinter/1b.347728306076327132/app/db/counter.py", line 28, in increment db.run_in_transaction(txn) File "/base/python

Haskell: How to timeout a function that runs an external command

邮差的信 提交于 2019-12-20 17:39:10
问题 I call an external program inside a function. Now i would like to timeout this function and not just the external program. But after the function times out, the external program is still running on my computer (i'm using debian) until it finishes its computation, after that its thread still remains in the process table as a subthread of my main program until the main program terminates. Here are two minimal examples which illustrates what i would like to do. The first uses unsafePerformIO,

Apply timeout control around Java operation

风流意气都作罢 提交于 2019-12-20 17:39:00
问题 I'm using a third party Java library to interact with a REST API. The REST API can sometimes take a long time to respond, eventually resulting in a java.net.ConnectException being thrown. I'd like to shorten the timeout period but have no means of modifying the third party library. I'd like to apply some form of timeout control around the calling of a Java method so that I can determine at what point to give up waiting. This doesn't relate directly to network timeouts. I'd like to be able to

Apply timeout control around Java operation

∥☆過路亽.° 提交于 2019-12-20 17:38:49
问题 I'm using a third party Java library to interact with a REST API. The REST API can sometimes take a long time to respond, eventually resulting in a java.net.ConnectException being thrown. I'd like to shorten the timeout period but have no means of modifying the third party library. I'd like to apply some form of timeout control around the calling of a Java method so that I can determine at what point to give up waiting. This doesn't relate directly to network timeouts. I'd like to be able to

Timeout in paramiko (python)

泪湿孤枕 提交于 2019-12-20 12:21:37
问题 I'm looking for a way to set a timeout for this: transport = paramiko.Transport((host, port)) transport.connect(username = username, password = password) sftp = paramiko.SFTPClient.from_transport(transport) sftp.get(remotepath, localpath) sftp.close() transport.close() 回答1: The connection timeout can be set with the timeout parameter (that indicated the number of seconds for the time out as described here) of the connect function. ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy

ASP.NET Forms Authentication timeout

南笙酒味 提交于 2019-12-20 09:48:52
问题 This could be a very simple question, but after a few hours trying to understand how this works on ASP.NET 4.0 I still don't know. I'm using Forms Authentication. I have a login page with a login control on it. This is what I need when users login: A- The users should stay logged until the don't do anything for the timeout set. If they reload a page the timeout has to restart the countdown. B- If they click the "Remember Me" check they should stay connected until they logout, no matter if

Bug in MVC3 - requests never time out. Works fine for aspx pages in same project

一世执手 提交于 2019-12-20 09:16:03
问题 I'm seeing this on our production site as well as a small test site I setup just to test this out... Basically, it appears that requests handled by mvc never time out. I've set an executionTimeout in my web.config and turned off debug mode. I've then added an infinite loop of thread.sleeps to both a regular aspx page and an mvc page (the loop is in the controller of the mvc page). The aspx page reliably times out (HttpException (0x80004005): Request timed out.), but the mvc page just spins

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding [closed]

三世轮回 提交于 2019-12-20 07:46:25
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . hi I'm getting an error Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding . I'm alredy changed the connect timeout = 60000 and in database my