Bug 136050 - Dumb closing of file descriptors
Summary: Dumb closing of file descriptors
Alias: None
Product: Fedora
Classification: Fedora
Component: squid   
(Show other bugs)
Version: 3
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jay Fenlason
QA Contact:
Depends On:
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:
Story Points: ---
Clone Of:
Last Closed: 2005-01-19 21:54:48 UTC
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 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):

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 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.