Forum OpenACS Q&A: User closes browser and Postgres backend process continues to chug on

We have a number of cases where an ADP page calls
a long-running SQL query and the user either hits stop
or actually closes the browser.

We see that the Postgres process that does the SELECT
continues to churn large percentages of CPU time even
though the http request doesnt exists anymore.

What is the correct remedy to prevent zombie backend postmaster processes from hosing the CPU forever?

thanks
Danny

Same thing will happen under Oracle ...

I don't personally know of any way for the driver to tell the backend to stop short of SIGHUP'ing the process, but I doubt that would work because AOLserver only runs as root long enough to grab port 80 and of course doesn't own the postgres processes ...

This isn't unique to OpenACS/AOLServer we see it with JBoss and other J2EE servers. Welcome to the wonderful world of stateless connections.

I might be wrong but I don't think the process is actually a zombie - surely the query will run to completion pass back the result and end. The fact that the result doesn't have anywhere to go is another matter.

Ah - a little bit of cross posting me thinks 😉