timeout

Premature end of script headers: index.php, mod_fcgid: read data timeout in 61 seconds

橙三吉。 提交于 2019-12-17 12:49:12
问题 I wrote a simple crawling script (in php) at localhost (with 4 variations). All of them worked fine at localhost. But when I made move them to shared hosting, two of them worked others gave internal server error. I looked at error_log and I saw these line: [Wed Jan 23 22:01:02 2013] [warn] [client ***] mod_fcgid: read data timeout in 61 seconds [Wed Jan 23 22:01:02 2013] [error] [client ***] Premature end of script headers: index.php I searched but I couldn't find any useful result. What is

Extending session timeout in PHP via the .htaccess

家住魔仙堡 提交于 2019-12-17 12:37:16
问题 I want to up the time my users will stay logged into my site without getting automatically logged out after a period of inactivity. I'm tracking the logged in status using PHP sessions. How can I set this, I'm trying to control this from my .htaccess file. 回答1: You can't do that from the htaccess file but You can change this line in your php.ini file. session.gc_maxlifetime = 1440 Update: it seems to be possible, so i stand corrected php_value session.gc_maxlifetime 3600 I haven't tried this

Simple timeout in java

女生的网名这么多〃 提交于 2019-12-17 10:52:58
问题 Can anyone guide me on how I can use a simple timeout in java? Basically in my project I'm executing a statement br.readLine() , which is reading a response from a modem. But sometimes the modem isn't responding. For that purpose I want to add a timeout. I'm looking for a code like: try { String s= br.readLine(); } catch(TimeoutException e) { System.out.println("Time out has occurred"); } 回答1: What you are looking for can be found here. It may exist a more elegant way to accomplish that, but

Set socket timeout in Ruby via SO_RCVTIMEO socket option

核能气质少年 提交于 2019-12-17 10:35:12
问题 I'm trying to make sockets timeout in Ruby via the SO_RCVTIMEO socket option however it seems to have no effect on any recent *nix operating system. Using Ruby's Timeout module is not an option as it requires spawning and joining threads for each timeout which can become expensive. In applications that require low socket timeouts and which have a high number of threads it essentially kills performance. This has been noted in many places including Stack Overflow. I've read Mike Perham's

Help troubleshooting SqlException: Timeout expired on connection, in a non-load situation

三世轮回 提交于 2019-12-17 10:17:43
问题 I have a server hosting a website of mine that has almost zero-traffic. A few people (< 20) enter the site every day, and a few RSS readers are subscribed to some feeds we put out. Almost every night, an RSS reader will hit us in the middle of the night and get an exception that the website can't connect to the SQL Server because of a Timeout in the connection. The details are extremely weird, so I'm looking for some help on what could be the issue, since I don't know where to start looking

Timeout function using threading in python does not work

你说的曾经没有我的故事 提交于 2019-12-17 09:49:05
问题 I have found a code creating a timeout function here, which does not seem to work. The complete test code is below: def timeout(func, args=(), kwargs={}, timeout_duration=1, default=None): import threading class InterruptableThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.result = None def run(self): try: self.result = func(*args, **kwargs) except: self.result = default it = InterruptableThread() it.start() it.join(timeout_duration) if it.isAlive(): return

Activity idle timeout for HistoryRecord?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 09:33:35
问题 W/ActivityManager( 81): Launch timeout has expired, giving up wake lock! W/ActivityManager( 81): Activity idle timeout for HistoryRecord Does anyone know what reason would cause this happens? Thanks. 回答1: It means that the Activity cannot be displayed because it is still trying to complete execution; meanwhile the ActivityManager has timed out. I had the same problem, and managed to resolve it by tidying up dependencies between Activity objects. I would recommend starting up the debugger.

Spring Boot Java Config Set Session Timeout

风格不统一 提交于 2019-12-17 09:33:34
问题 How can I configure my (embedded) Tomcat Session Timeout in a Spring Boot Application? public class SessionListener implements HttpSessionListener{ @Override public void sessionCreated(HttpSessionEvent se) { se.getSession().setMaxInactiveInterval(5*60); } @Override public void sessionDestroyed(HttpSessionEvent se) { }} I have a SessionListener but I have no idea in which class I have to add this Listener to the Context. 回答1: You should be able to set the server.session.timeout in your

Kill or terminate subprocess when timeout?

醉酒当歌 提交于 2019-12-17 08:53:07
问题 I would like to repeatedly execute a subprocess as fast as possible. However, sometimes the process will take too long, so I want to kill it. I use signal.signal(...) like below: ppid=pipeexe.pid signal.signal(signal.SIGALRM, stop_handler) signal.alarm(1) ..... def stop_handler(signal, frame): print 'Stop test'+testdir+'for time out' if(pipeexe.poll()==None and hasattr(signal, "SIGKILL")): os.kill(ppid, signal.SIGKILL) return False but sometime this code will try to stop the next round from

Apache HttpClient timeout

耗尽温柔 提交于 2019-12-17 08:29:27
问题 Is there a way to specify a timeout for the whole execution of HttpClient? I have tried the following: httpClient.getParams().setParameter("http.socket.timeout", timeout * 1000); httpClient.getParams().setParameter("http.connection.timeout", timeout * 1000); httpClient.getParams().setParameter("http.connection-manager.timeout", new Long(timeout * 1000)); httpClient.getParams().setParameter("http.protocol.head-body-timeout", timeout * 1000); It actually works fine, except if a remote host