From: | Tomasz Ostrowski <tometzky(at)batory(dot)org(dot)pl> |
---|---|
To: | Stumo <stumo(at)stumo(dot)org(dot)uk> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Running function automatically on (unclean) disconnect |
Date: | 2008-03-25 09:11:48 |
Message-ID: | 47E8C1D4.5010808@batory.org.pl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Stumo wrote:
> Each client retrieves an unprocessed record from the server, marks
> that it's processing that record, does some processing (this will take
> some time), and adds some extra data to the server based on the
> processing. [snip]
>
> However, if a client disconnects (which, because of the system I am
> using, is relatively likely) then the record will still be marked as
> processing even though nothing is processing it.
Just create a timeout for processing - if a worker process will fail or
disconnect then a job will time out. Choose jobs for processing from
jobs in not-processed or timed-out state. It is much more reliable -
will work even when backend or server will die or when a worker will hang.
Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
Winnie the Pooh
From | Date | Subject | |
---|---|---|---|
Next Message | Magnus Hagander | 2008-03-25 09:19:41 | Re: Install Postgresql on Win2000 with Admin Rights |
Previous Message | sathiya psql | 2008-03-25 08:51:20 | postgresql is slow with larger table even it is in RAM |