Re: Make PQgetResult() not return NULL on out-of-memory error - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Make PQgetResult() not return NULL on out-of-memory error
Date
Msg-id CAHGQGwG_sv750JMUvN0A6WB7HTVTYmLsDNP3KfZhe1RSoodqjA@mail.gmail.com
Whole thread Raw
In response to Re: Make PQgetResult() not return NULL on out-of-memory error  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: Make PQgetResult() not return NULL on out-of-memory error
List pgsql-hackers
> > Therefore, I wonder about closing the connection and resetting the status
> > when OOM_result is retunred, by callling pqDropConnection() as handleFatalError() does.
> > In this case, the connection status should also be set to CONNECTINO_BAD.

There are many code paths in libpq that can trigger an out-of-memory error.
However, this patch makes libpq drop the connection when OOM_result is returned,
which likely covers only a subset of those cases. So I'm not sure dropping
the connection only for OOM_result would meaningfully improve things.

Perhaps it would be more consistent to drop the connection for any
internal libpq error
such as out-of-memory, though that might require invasive code changes and coul
 break existing applications, I'm afraid.

Regards,

-- 
Fujii Masao



pgsql-hackers by date:

Previous
From: Steven Niu
Date:
Subject: Re: Fix incorrect assignment of InvalidXLogRecPtr to a non-LSN variable.
Next
From: Dilip Kumar
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication