Bug 136050 - Dumb closing of file descriptors
Dumb closing of file descriptors
Product: Fedora
Classification: Fedora
Component: squid (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jay Fenlason
Depends On:
  Show dependency treegraph
Reported: 2004-10-17 03:10 EDT by Ulrich Drepper
Modified: 2014-08-31 19:26 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-01-19 16:54:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Ulrich Drepper 2004-10-17 03:10:54 EDT
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):

How reproducible:

Steps to Reproduce:
1.strace starting squid
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 03:12:04 EDT
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 16:54:48 EST
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.