Re: [bug fix] dblink leaks unnamed connections

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "Peter Eisentraut (peter(dot)eisentraut(at)2ndquadrant(dot)com)" <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: Re: [bug fix] dblink leaks unnamed connections
Date: 2017-03-11 21:37:36
Message-ID: 92fd3d0b-f986-9cd6-068e-9d305760674d@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/09/2017 08:31 AM, Joe Conway wrote:
> On 03/09/2017 07:54 AM, Tom Lane wrote:
>> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>>> On Wed, Mar 8, 2017 at 3:52 PM, Tsunakawa, Takayuki
>>> <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> wrote:
>>>> dblink fails to close the unnamed connection as follows when a new unnamed connection is requested. The attached patch fixes this.
>>
>>> This issue was reported about ten years ago and added as TODO item.
>>> http://archives.postgresql.org/pgsql-hackers/2007-10/msg00895.php
>>
>>> I agree that this is a bug, and am tempted to back-patch to all the supported
>>> versions. But it had not been fixed in many years since the first report of
>>> the issue. So I'm not sure if it's ok to just treat this as a bug right now and
>>> back-patch. Or we should fix this only in HEAD? Anyway I'd like to hear
>>> more opinions about this.
>>
>> It looks to me like the issue simply fell through the cracks because Joe
>> wasn't excited about fixing it. Now that we have a second complaint,
>> I think it's worth treating as a bug and back-patching.
>>
>> (I've not read this particular patch and am not expressing an opinion
>> whether it's correct.)
>
> Ok, will take another look.

I pushed a fix to all supported branches.

Thanks,

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Eric Ridge 2017-03-11 21:58:00 Re: How to get the 'ctid' from a record type?
Previous Message Tom Lane 2017-03-11 21:17:24 Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)