ADO.NET calling T-SQL Stored Procedure causes a SqlTimeoutException

Once I determined that it is the ADO.NET connection at the root of the problem, this thread led me to the answer. Basically connections through Sql Server Management Studio (SSMS) by default have SET ARITHABORT ON. ADO.NET connections do not. Setting ARITHABORT OFF and executing the query directly through SSMS gives me the same slow … Read more

How can I stop a MySQL query if it takes too long?

There is a nice Perl script on CPAN to do just this: http://search.cpan.org/~rsoliv/mysql-genocide-0.03/mysql-genocide One only needs to schedule it to run with the proper parameters. Create a CRONtab file /etc/cron.d/mysql_query_timeout to schedule it to run every minute: * * * * * root /path/to/mysql-genocide -t 7200 -s -K Where 7200 is the maxiumum allowed execution … Read more

What is the global default timeout

I suspect this is implementation-dependent. That said, for CPython: From socket.create_connection, If no timeout is supplied, the global default timeout setting returned by :func:getdefaulttimeout is used. From socketmodule.c, static PyObject * socket_getdefaulttimeout(PyObject *self) { if (defaulttimeout < 0.0) { Py_INCREF(Py_None); return Py_None; } else return PyFloat_FromDouble(defaulttimeout); } Earlier in the same file, static double defaulttimeout … Read more

Retry a Bash command with timeout

You can simplify things a bit by putting command right in the test and doing increments a bit differently. Otherwise the script looks fine: NEXT_WAIT_TIME=0 until [ $NEXT_WAIT_TIME -eq 5 ] || command; do sleep $(( NEXT_WAIT_TIME++ )) done [ $NEXT_WAIT_TIME -lt 5 ]

exec() with timeout

I’ve searched a bit on this topic and came to conclusion that in some case (if you are using linux) you can use ‘timeout’ command. It’s pretty flexible Usage: timeout [OPTION] DURATION COMMAND [ARG]… or: timeout [OPTION] in my particular case I’m trying to run sphinx indexer from PHP, kinda migration data script so I … Read more