天道酬勤,学无止境

timeout

Python psycopg2 超时(Python psycopg2 timeout)

问题 我有一个大问题:运行我的 python 软件的服务器的路由器上似乎存在一些硬件问题。 大约每三次连接到数据库就成功一次。 所以 psycopg2.connect() 在我收到超时异常之前最多可能需要 5 分钟。 2014-12-23 15:03:12,461 - ERROR - could not connect to server: Connection timed out Is the server running on host "172.20.19.1" and accepting 这就是我正在使用的代码。 # Connection to the DB try: db = psycopg2.connect(host=dhost, database=ddatabase, user=duser, password=dpassword) cursor = db.cursor(cursor_factory=psycopg2.extras.DictCursor) except psycopg2.DatabaseError, err: print(str(err)) logging.error(str(err)) logging.info('program terminated') sys.exit(1) 我为查询尝试了一些超时添加,但这没有帮助,因为根本没有建立连接。

2021-06-21 09:48:42    分类:技术分享    python   postgresql   connection   timeout   psycopg2

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

I'm not sure if this is a VB.NET error or SQL Server. But I get the above error with following stack trace: [SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194 System.Data.SqlClient.TdsParser.Run

2021-06-15 17:58:32    分类:问答    vb.net   visual-studio-2008   timeout

Bean Transaction Timeout in WebSphere using EJB Timer

With JBoss/Wildfly one is able to use the @TransactionTimeout proprietary annotation and define a transaction timeout for a specific Session Bean. What is the equivalent way of doing it using IBM WebSphere? We are using EJB Timer and one of the Beans will over an hour to complete. Sample code for Wildfly: import org.jboss.ejb3.annotation.TransactionTimeout; @Stateless @TransactionTimeout(value=7200) public class TimerBean { } Note: Using WebSphere 8.5. Modifying the global transaction time is not an option, we need to do it for a specific Session Bean, or maybe an Application (EAR).

2021-06-15 05:16:27    分类:问答    java   jakarta-ee   timeout   websphere   ejb-3.0

what is the maximum timeout can be set in jquery ajax?

$.ajax( url:"", async: true, timeout: 2*60*60*1000, //2 hours, success: function(){}, error: function(){} ); In a jQuery ajax request, if I set the timeout with a big value, or left it empty, will it keep waiting until the server returns a result? Actually, I expect the server will response in 1.5 hours, so in my js script I set timeout to 2 hours, but I found the Ajax jump to error function (with msg code 404) in less than 1 hour. It means ajax abort the waiting ahead of the time . So I wonder if there is a maximum timeout value can ajax be set?

2021-06-15 03:50:16    分类:问答    javascript   jquery   ajax   timeout   http-status-code-404

How to see SQL 2008 Locks and Blocked Tables

During the ASP.NET execution of my app, it seems SQL 2008 Express holds some lock, and I get Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding Maybe some of my query is not optimized. Visual Studio crashes with: Microsoft Visual Studio may be unstable now. It is recommended that you save all files and exit. I need to see what query is blocking my tables, but I have the Express version. How can I do? Thanks

2021-06-15 03:31:02    分类:问答    asp.net   sql-server   timeout   locking   deadlock

handle lwp timeout effectively

I am using LWP to download content from web pages, and I would like to limit the amount of time it waits for a page. This is accomplished in lwp like this: my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->get($url); And this works fine, except for whenever the timeout reaches its limit, it just dies and I can't continue on with the script! I'd really like to handle this timeout properly so that I can record that the url had a timeout and then move on to my next one. Does anyone know how to do this? Thanks!

2021-06-14 18:01:31    分类:问答    perl   timeout   lwp   lwp-useragent

“ERROR 2013 (HY000): Lost connection to MySQL server during query” while dropping database

I have an empty database that I cannot drop. Initially, it contained a table that I couldn't SELECT from. So I DROP'ed all tables from that database and tried to DROP the database without success : mysql> drop database my_database; ERROR 2013 (HY000): Lost connection to MySQL server during query Now I have an empty database that I cannot remove in my server. I check the mysql error.log, here is the output : 130812 10:02:45 InnoDB: Assertion failure in thread 140409656780544 in file row0mysql.c line 3682 InnoDB: Failing assertion: table InnoDB: We intentionally generate a memory trap. InnoDB

2021-06-14 17:07:47    分类:问答    mysql   sql   timeout   drop-database

How does Mockito timeout work?

I'm new to Mockito and JUnit and try to understand basic unit testing with these frameworks. Most concepts in JUnit and Mockito seem straightforward and understandable. However, I got stuck with timeout in Mockito. Does timeout in Mockito play the same role as it does in JUnit? Bellow is my code. @Mock Timeoutable timeoutable; @Test(timeout = 100) public void testJUnitTimeout() { try { Thread.sleep(2000); } catch (InterruptedException ie) { } } @Test public void testMockitoTimeout(){ doAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocation){ try { Thread.sleep(1000);

2021-06-14 14:42:21    分类:问答    java   junit   timeout   mockito

Linq Stored Procedure Timeout but SSMS Quick

I have a stored procedure which I am calling using LinqToSQL. I'm not doing anything special at all, e.g. MyDataContext db = new MyDataContext() var results = db.storedProcedure(param1, param2, param3) // Do stuff When I run the stored procedure using the exact same parameters I get results between 2 and 6 seconds. The database is a remote database. However, when I run the stored procedure it takes (after debugging....) 275 seconds! Under normal circumstances this gives the following exception: [Win32Exception (0x80004005): The wait operation timed out] [SqlException (0x80131904): Timeout

2021-06-14 14:40:31    分类:问答    sql   linq   linq-to-sql   timeout

Unable to Start Tomcat 7.0 in Eclipse Indigo

I've to start working on a web-app project for which I've Eclipse Indigo and Tomcat 7.0 installed. The environment also has JRE 7, Android SDK in it. But whenever I start the server, it gets timed out! Moreover, I'm able to start the server outside Eclipse and sucessfully execute a web app in the browser. But to debug, I would rather have it in Eclipse. The error message is: Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor. In the console I get: Mar 14, 2012 11:51:18 PM org.apache

2021-06-14 14:23:29    分类:问答    java   eclipse   tomcat   timeout