Received: (qmail 7660 invoked by uid 2012); 9 Aug 1999 19:06:54 -0000 Message-Id: <19990809190654.7659.qmail@hyperreal.org> Date: 9 Aug 1999 19:06:54 -0000 From: Jim Cox Reply-To: jc@superlink.net To: apbugs@hyperreal.org Subject: ApacheBench (ab) can perform more requests than specified on command line X-Send-Pr-Version: 3.2 >Number: 4839 >Category: test >Synopsis: ApacheBench (ab) can perform more requests than specified on command line >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Mon Aug 9 12:10:01 PDT 1999 >Last-Modified: Wed Oct 27 00:14:23 PDT 1999 >Originator: jc@superlink.net >Organization: >Release: 1.3_19990809131309 source >Environment: SunOS 5.6 Generic_105181-03 sparc >Description: When the call to connect() inside start_connect() doesn't block, a call to write_request() is performed without checking that the number of 'done' requests is less than the requested amount. >How-To-Repeat: Execute 'ab -n 1 -c 1' in a situation where the connect() call won't block (e.g. on the same physical host as the web server) -- two requests will be made to the web server, although ab will only report on one of them (because it abandons the socket after calling write_request() the second time). >Fix: Either remove the call to write_request() in start_connect(), or check the number of done requests before calling write_request(). Here's a diff for the first option: *** ab.c.baseline Mon Aug 9 14:51:10 1999 --- ab.c Mon Aug 9 14:51:04 1999 *************** *** 536,542 **** } /* connected first time */ ! write_request(c); } /* --------------------------------------------------------- */ --- 536,543 ---- } /* connected first time */ ! c->state = STATE_CONNECTING; ! FD_SET(c->fd, &writebits); } /* --------------------------------------------------------- */ >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: rse State-Changed-When: Wed Oct 27 00:14:23 PDT 1999 State-Changed-Why: Taken over for Apache 1.3.10. Thanks for your feedback. >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]