ERROR: canceling query due to user request

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема ERROR: canceling query due to user request
Дата
Msg-id s325a4d1.095@gwmta.wicourts.gov
обсуждение исходный текст
Ответы Re: ERROR: canceling query due to user request  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
I started with this issue on the pgsql-jdbc list, but was assured that this could not be a bug in the JDBC driver -- it
iseither a bug in the configuration or runtime environment or it is a server-side bug.  This list seemed like the
logicalnext step. 

We have seen this behavior in 8.0.3 with the 311 JDBC driver.  Today I tested with the latest snapshot of the 8.1
developmentcode and the tip of the JDBC driver code from the root.  It still happens. 

The environment for the latest test is:
SuSE Linux 9.3 (i586)
2.6.11.4-21.8-smp #1 SMP Tue Jul 19 12:42:37 UTC 2005
Dual Xeon
Disk on 7 spindle RAID 5 via SAN
All access through JDBC connections.
A single thread accessing the database.
A connection pool in use -- the thread may grab a different connection each time.
No other process concurrently executing against the database.
Happens with or without autovacuum running.

Failures have also occured on Windows 2000 and Windows XP servers with local hard drives.  Xeons in all cases.

The software involved "optimistically" tries to do a series of inserts, updates, and/or deletes in a single database
transaction. If an exception occurs (for example an insert of a row which already exists) or an update affects zero
rows,the transaction is rolled back and the operations are attempted in "cautious" mode -- a commit after each insert
updateor delete of a single row. 

The client is running full out, with a steady supply of ready-to-go requests.  Client CPU seems to be the bottleneck,
ratherthan anything on the database server hardware.  We are only seeing this problem in "cautious" mode -- a database
transactionhas been rolled back and we're committing each statement as we go. 

If we run the same set of data multiple times, the error occurs on different requests each time, indicating it is not
datadependent.  If we turn on logging at the JDBC driver level, it never happens, indicating that it is timing
sensitive. We've never seen it while stepping through the debugger, but since it seems to happen randomly once every
fewthousand requests, that would be a unlikely anyway. 

The error is manifest by this message and stack trace:

org.postgresql.util.PSQLException: ERROR: canceling query due to user request
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1499)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1284)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.executeTransactionCommand(AbstractJdbc2Connection.java:617)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.commit(AbstractJdbc2Connection.java:637)
    at (our application code)

There is no method in the JDBC interface to cancel a commit from the client side, and there is nothing in the client
codewhich is trying to do so.  There are no processes running on the server except services from the SuSE install and
theprocesses started by pg_ctl start. 

We tried setting the ulimit of everything to unlimited, where allowed.  We set the open files limit to 4096.  These
ulimitchanges had no affect on the problem. 

Does anyone have any ideas on a possible cause, or any diagnostic steps we should take?

Thanks,

-Kevin




В списке pgsql-admin по дате отправления:

Предыдущее
От: Ezra Taylor
Дата:
Сообщение: Re: How to improve Postgres performance
Следующее
От: "Lane Van Ingen"
Дата:
Сообщение: Server Time Setting