Bug 136057

Summary: O_NONBLOCK for files breaks squid
Product: [Fedora] Fedora Reporter: Alexandre Oliva <oliva>
Component: kernelAssignee: Dave Jones <davej>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: rawhideCC: barryn, bugs.michael, pfrields, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.6.9-1.639 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-20 18:48:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 136049    

Description Alexandre Oliva 2004-10-17 09:13:46 UTC
Description of problem:
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done
squid won't start when running under kernel 2.6.8-1.624, because of
the changes related with O_NONBLOCK for files.  The symptom is that
the init script takes a while to complete, and then reports squid
failed.  strace reveals squid is attempting to read the error message
files from /etc/squid/errors, and getting -EAGAIN errors in return.

If you cat all files in there to bring them into memory, squid starts
successfully, but it won't serve out cached content because of the
same issue.  It poll()s cached files, and gets indications that the
cache files are ready for input, but when it attempts to read from
them, it gets -EAGAIN errors.

It's possible to get squid to make progress, instead of eating all CPU
repeatedly calling poll and read, the latter of which fails, by
starting the following script after starting squid:

pid=`pidof '(squid)'`; while :; do lsof -p $pid | sed -n
's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' | xargs cat /dev/null >
/dev/null; sleep 5; done

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

How reproducible:
Every time

Steps to Reproduce:
1.service squid start
2.cat /etc/squid/errors/* > /dev/null; service squid start
3.http_proxy=localhost:3128 links some_cached_url
  
Actual results:
1 fails.  2 works, but 3 won't get the page contents unless they
happened to be in memory.

Expected results:
1 fails.  2 works, but 3 won't get the page contents unless they
happened to be in memory.

Additional info:

Comment 1 Alexandre Oliva 2004-10-17 20:53:12 UTC
Ugh, osrry about the mess that this bug report turned out to be.  VNC
and Firefox don't quite live happily in my environment :-(  Looks like
a single C-v was for some reason interpreted as 10+ instances thereof,
and  I failed to notice that.  Also, I goofed in the `expect results',
that should have read `the usual' :-)

Comment 2 Michael Schwendt 2004-10-18 09:17:09 UTC
I assume this is not specific to Squid, because kernel-2.6.8-1.624
breaks 'gqview' into pieces. It fails to recognize/load any images
files at all. With the older 1.541 kernel I kept, it works okay.


Comment 3 Bill Nottingham 2004-10-19 04:48:50 UTC
Should be fixed in 2.6.9-1.635. 

Comment 4 Alexandre Oliva 2004-10-20 18:48:55 UTC
Confirmed fixed in 1.639.