Re: Considering signal handling in plpython again

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Hubert Zhang <hzhang(at)pivotal(dot)io>,Robert Eckhardt <reckhardt(at)pivotal(dot)io>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Considering signal handling in plpython again
Date: 2018-05-11 13:28:04
Message-ID: 974B452F-601D-401F-87FF-B02B8250588F@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11 May 2018 10:01:56 EEST, Hubert Zhang <hzhang(at)pivotal(dot)io> wrote:
>2. Add a flag in hook function to indicate whether to call
>Py_AddPendingCall.
>This is straightforward.(I prefer it)

Yeah, that's what I had in mind, too. A global bool variable that's set when you enter libpython, and cleared on return. Need to handle nesting, i.e if a PL/python function runs a slow query with SPI, and cancellation happens during that. And the case that the SPI query calls another PL/python function.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Blackwell 2018-05-11 13:59:23 perlcritic: Missing "return"
Previous Message Hartmut Holzgraefe 2018-05-11 13:21:08 Re: Having query cache in core