Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [EXTERNAL] Re: Add non-blocking version of PQcancel
Дата
Msg-id 202403120919.fxltdpmxq4u4@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: [EXTERNAL] Re: Add non-blocking version of PQcancel  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Ответы Re: [EXTERNAL] Re: Add non-blocking version of PQcancel  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Re: [EXTERNAL] Re: Add non-blocking version of PQcancel  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Список pgsql-hackers
Here's a last one for the cfbot.

I have a question about this one

int
PQcancelStart(PGcancelConn *cancelConn)
{
    [...]
    if (cancelConn->conn.status != CONNECTION_ALLOCATED)
    {
        libpq_append_conn_error(&cancelConn->conn,
                                "cancel request is already being sent on this connection");
        cancelConn->conn.status = CONNECTION_BAD;
        return 0;
    }


If we do this and we see conn.status is not ALLOCATED, meaning a cancel
is already ongoing, shouldn't we leave conn.status alone instead of
changing to CONNECTION_BAD?  I mean, we shouldn't be juggling the elbow
of whoever's doing that, should we?  Maybe just add the error message
and return 0?

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"If it is not right, do not do it.
If it is not true, do not say it." (Marcus Aurelius, Meditations)

Вложения

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

Предыдущее
От: Alexander Lakhin
Дата:
Сообщение: Re: Spurious pgstat_drop_replslot() call
Следующее
От: Himanshu Upadhyaya
Дата:
Сообщение: Re: remaining sql/json patches