Re: flock user defined function

From: Chris Goughnour <cgoughnour(at)hotp(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: flock user defined function
Date: 2004-06-22 23:02:37
Message-ID: BCFE089D.A11E%cgoughnour@hotp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks. Yeah, I figured that out after Martijn's response. I'm just
returning the file descriptor from lockFile, passing it to unlockFile and
closing the descriptor there. It works fine now. Thanks for edifying a
clueless novice such as myself. :-)
> Chris Goughnour <cgoughnour(at)hotp(dot)com> writes:
>> Any suggestions? Thanks in advance.
>
> I believe locks are associated with file descriptors (what you're
> miscalling a handle). The unlock function cannot release a lock
> that is held via a different descriptor. What it needs to be doing
> is closing the descriptor that lockFile opened. This would also
> solve the rather serious descriptor-leak problem you've got.
>
> regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-06-22 23:04:35 Re: Connection gets into state where all queries fail
Previous Message Doug McNaught 2004-06-22 22:50:33 Re: flock user defined function