Bug 136050 - Dumb closing of file descriptors
Summary: Dumb closing of file descriptors
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: squid
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jay Fenlason
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-10-17 07:10 UTC by Ulrich Drepper
Modified: 2014-08-31 23:26 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-01-19 21:54:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Replace dumb loops with something more intelligent (1.27 KB, patch)
2004-10-17 07:12 UTC, Ulrich Drepper
no flags Details | Diff

Description Ulrich Drepper 2004-10-17 07:10:54 UTC
Description of problem:
On two occasions squid closes all file descriptors but the standard
three.  This is done by iterating over all possible descriptor values
and calling close.  There is a better way.  Just image what the code
would do if the max fd count is 16k or more.

Version-Release number of selected component (if applicable):
squid-2.5.STABLE6-2

How reproducible:
always

Steps to Reproduce:
1.strace starting squid
2.
3.
  
Actual results:
thousands of close() calls

Expected results:
normally none since there are no excess desriptors in use

Additional info:
I'll attach a patch.

Comment 1 Ulrich Drepper 2004-10-17 07:12:04 UTC
Created attachment 105346 [details]
Replace dumb loops with something more intelligent

This works on all Linux systems.  It's not portable but this is an OPP.

Comment 2 Jay Fenlason 2005-01-19 21:54:48 UTC
Upstream noticed that closing file descriptors that're being used by 
various libraries (ssl, syslog, etc) can Be Bad.  The squid I just 
built into Rawhide includes a patch to correct its behavior. 


Note You need to log in before you can comment on or make changes to this bug.