Jan Wieck JanWieck
Fri Dec 1 06:56:12 PST 2006
On 11/30/2006 3:07 PM, Christopher Browne wrote:
> Niels Breet wrote:
>> I had this problem:
>> 2006-11-29 20:51:41 CET FATAL  slon: sched_wakeuppipe create failed -(24)
>> Too many open files
>>
>> When slon is started and the local database is down, slon now tries
>> to reconnect. Before 1.2 we would bail out, but now we restart the
>> thread. slon_terminate_worker() doesn't close the currently opened
>> sched_wakeuppipe, so after a few loops we have too many open files.
>>
>> I just added this to the end of slon_terminate_worker():
>>         close(sched_wakeuppipe[0]);
>>         close(sched_wakeuppipe[1]);
>>
>> I'm sure there is a better solution, but that solves the problem.
>>
>>   
> That doesn't look like a half bad answer, all by itself.  I'm taking a
> look at how those objects (some are pipes) get opened to see if there's
> some more general approach.  But that looks like a good common place
> where they do need closing.

It looks like a perfectly fine solution to me. Fact is that file 
descriptors of any kind (pipe, socket or whatever) are objects on the 
process level. There is no mechanism to tell the OS to clean anything up 
automagically on thread termination. So one can either close them 
explicitly or attempt to reuse the existing pipe. I am in favor of 
closing and a fresh start.


Jan


-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck at Yahoo.com #



More information about the Slony1-general mailing list