Perlbal - Perlbal bug: Race condition with web_server role in _serve_request

This is Interesting: Free IT Magazines  
Home > Archive > Perlbal > August 2007 > Perlbal bug: Race condition with web_server role in _serve_request





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Perlbal bug: Race condition with web_server role in _serve_request
Jeremy James

2007-08-30, 1:12 pm

Hi folks,

We've had problems recently with Perlbal either returning null requests
or otherwise invalid data - on some occasions making Perlbal go into a
100% CPU loop. strace revealed frequent calls to sendfile returning 0
bytes sent.

Looking at the fds involved revealed this was occuring on serving
particular files in web_server mode - indeed files that we know to be
changing quite frequently.

_serve_request in ClientHTTPBase calls aio_stat to decide how to handle
the file - particular with respect to not found, directories, and how to
handle ranges. It then calls aio_open later on, and uses calls
reproxy_fh with the size determined from the earlier stat.

However, our file is being changed in the meantime (in this case, to be
shorter), a overlength read occurs, and anything could happen...

We've bypassed the problem for now (reproxying affected files from
apache), but will work on a patch soon - opening the file first, then
call stat on the filehandle, obviously taking care to handle notfound
and directory cases - although I'd rather there was an official patch,
as I may not have enough understanding of other non-explicit edge cases...

Best wishes,
Jeremy

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com