Re: [squid-users] Squid loops on epoll/read/gettimeofday

From: Marcus Kool <marcus.kool_at_urlfilterdb.com>
Date: Fri, 02 Apr 2010 19:00:14 -0300

Henrik Nordström wrote:
> fre 2010-04-02 klockan 15:41 -0300 skrev Marcus Kool:
>
>> strange indeed, but this is strace output with which I am not very familiar.
>> Strace should print the whole array that it uses as argument to
>> epoll_wait or just prints the first element ? (and the 2nd argument
>> could be FD 27)
>
> For epoll_wait it prints the valid entries in the result array, which
> has length 1 in this case (see return value last on the line).
>
>>> Can you please use cachemgr to view the current filedescriptors page to
>>> note what fd 23 & fd 27 is being used for?
>> I restarted Squid and now it does not loop...
>> The lsof output in the original email is of little help:
>
> A little. Both are pipes. And it's not unlikely these pipes have the
> same fd assignments now after restart. What does cachemgr say now?

I use this Squid at home and it lightly used so maybe it does have
the same FDs allocated after a restart...
Cachemgr gives this (after the restart):

Active file descriptors:
File Type Tout Nread * Nwrite * Remote Address Description
---- ------ ---- -------- -------- --------------------- ------------------------------
    5 Log 0 0 0 /local/squid/logs/cache.log
    7 Socket 0 1275 241 .0 DNS Socket
    8 Pipe 0 63 9934 ufdbgclient #1
    9 Pipe 0 0* 0 ufdbgclient #2
   10 Pipe 0 0* 0 ufdbgclient #3
   11 Pipe 0 0* 0 ufdbgclient #4
   12 Pipe 0 0* 0 ufdbgclient #5
   13 Pipe 0 0* 0 ufdbgclient #6
   14 Pipe 0 0* 0 ufdbgclient #7
   15 Pipe 0 0* 0 ufdbgclient #8
   16 Pipe 0 0* 0 ufdbgclient #9
   17 Pipe 0 0* 0 ufdbgclient #10
   18 Pipe 0 0* 0 ufdbgclient #11
   19 Pipe 0 0* 0 ufdbgclient #12
   20 File 0 0 8242 /local/squid/logs/access.log
   21 Pipe 0 0 0 unlinkd -> squid
   22 File 0 0 312 /local/squid/cache/swap.state
   23 Socket 1440 848* 0 10.2.2.9.56505
http://srv004.home01.urlfilterdb.com/Squid/cgi-bin/cachemgr.cgi
   24 Pipe 0 0 0 squid -> unlinkd
   25 Socket 0 0 0 .0 HTTP Socket
   26 Socket 2 0* 1794 10.2.2.9.80
http://srv004.home01.urlfilterdb.com/Squid/cgi-bin/cachemgr.cgi
   27 Socket 1440 170* 0* 127.0.0.1.35576
cache_object://localhost/filedescriptors
   28 Pipe 0 0* 0 async-io completetion event: main
   29 Pipe 0 0 0 async-io completetion event: threads

>> squid 13665 squid 20w REG 9,3 1478687 4718702 /local/squid/logs/access.log
>> squid 13665 squid 21r FIFO 0,6 1723502 pipe
>> squid 13665 squid 22w REG 9,3 30400812 4718715
>> /local/squid/cache/swap.state
>> squid 13665 squid 23r FIFO 0,6 1723506 pipe
>> squid 13665 squid 24w FIFO 0,6 1723503 pipe
>> squid 13665 squid 25u IPv4 1723505 TCP *:squid (LISTEN)
>> squid 13665 squid 26w FIFO 0,6 1723506 pipe
>> squid 13665 squid 27r FIFO 0,6 1723507 pipe FD 27 *****
>> squid 13665 squid 28w FIFO 0,6 1723507 pipe
>> squid 13665 squid 29u IPv4 1771231 TCP srv004:squid->xxx
>> (ESTABLISHED)
>>
>> It seems that FD 27 and 28 point to the same object (as FD 23 and FD 26)
>
> Hmm..
>
>> The strace output lists the parameters at the call time and
>> we do not see the return values (only the function return value).
>
> Should be return values. strace knows how epoll_wait works.
>
>> Is it possible that FD 27 has an EPOLLERR condition instead of a
>> EPOLLIN condition and the loop is caused by trying to do read() on FD 27 ?
>> (I do not see any check for a return of EPOLLERR in the sources).
>
> read should not return EAGAIN if there is an pending error condition.
>
> Regards
> Henrik
>
>
>
Received on Fri Apr 02 2010 - 22:00:22 MDT

This archive was generated by hypermail 2.2.0 : Sun Apr 04 2010 - 12:00:03 MDT