Discussion:
What is causing 'canceling statement due to user request' ?
Csaba Nagy
2006-10-23 14:14:38 UTC
Permalink
Hi all,

I know of 2 causes:

- hit CTRL-C in the psql client;
- have a non-zero statement timeout and have the statement actually
time out;

But I am seeing this via JDBC which can't cancel a statement AFAIK, and
the statement_timeout is set to 0 (in the config file globally, and
there's no override for the users, nor in our JDBC code).

I wonder if there is any other scenario which can trigger this error ? I
found a lot of them in our logs, last night we had hundreds of them, but
now that I looked it happened sporadically in the past too...

Could some network problem trigger this ?

TIA,
Csaba.



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/
Tom Lane
2006-10-24 14:49:30 UTC
Permalink
Post by Csaba Nagy
I wonder if there is any other scenario which can trigger this error ?
Anything sending SIGINT to a backend process would result in this
behavior. We've heard rumors that there are platforms wherein SIGINT
is used for strange purposes like enforcing process-runtime limits.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match
Thomas Kellerer
2006-10-24 14:50:17 UTC
Permalink
Post by Csaba Nagy
Hi all,
- hit CTRL-C in the psql client;
- have a non-zero statement timeout and have the statement actually
time out;
But I am seeing this via JDBC which can't cancel a statement AFAIK
JDBC *can* cancel a running statement. You just need to call cancel()
from another thread.

http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Statement.html#cancel()

Works great in my SQL front end.

Thomas


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
Csaba Nagy
2006-10-27 08:13:17 UTC
Permalink
Post by Thomas Kellerer
JDBC *can* cancel a running statement. You just need to call cancel()
from another thread.
http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Statement.html#cancel()
Works great in my SQL front end.
Are you sure ? Ever tried to cancel a long running statement and see if
it is still running in the DB after you cancelled it on the JDBC side ?

Cheers,
Csaba.



---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
Thomas Kellerer
2006-10-30 07:27:52 UTC
Permalink
Post by Csaba Nagy
Post by Thomas Kellerer
JDBC *can* cancel a running statement. You just need to call cancel()
from another thread.
http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Statement.html#cancel()
Works great in my SQL front end.
Are you sure ? Ever tried to cancel a long running statement and see if
it is still running in the DB after you cancelled it on the JDBC side ?
Hmm. Pretty sure, I did not really check the server itself, but I could
see that the CPU load (running a local Postgres) went down immediately,
which I took that the statement was no longer processed by the server.

Thomas


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Continue reading on narkive:
Loading...