Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 68096 invoked from network); 30 Mar 2011 19:31:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Mar 2011 19:31:09 -0000 Received: (qmail 32868 invoked by uid 500); 30 Mar 2011 19:31:07 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 32840 invoked by uid 500); 30 Mar 2011 19:31:07 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 32832 invoked by uid 99); 30 Mar 2011 19:31:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Mar 2011 19:31:07 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.214.44] (HELO mail-bw0-f44.google.com) (209.85.214.44) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Mar 2011 19:31:00 +0000 Received: by bwz13 with SMTP id 13so1322219bwz.31 for ; Wed, 30 Mar 2011 12:30:40 -0700 (PDT) Received: by 10.204.155.80 with SMTP id r16mr1557960bkw.36.1301513440234; Wed, 30 Mar 2011 12:30:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.126.231 with HTTP; Wed, 30 Mar 2011 12:30:20 -0700 (PDT) X-Originating-IP: [24.23.118.38] In-Reply-To: References: From: William Oberman Date: Wed, 30 Mar 2011 15:30:20 -0400 Message-ID: Subject: Re: who to contact? To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=00151748e940468c2e049fb83691 X-Virus-Checked: Checked by ClamAV on apache.org --00151748e940468c2e049fb83691 Content-Type: text/plain; charset=ISO-8859-1 Sorry, 0.7.a.3, I was just checking now if my issue still applies in either new thrift or later phpcassa's. Probably jumped the gun on emailing this. On Wed, Mar 30, 2011 at 3:28 PM, Tyler Hobbs wrote: > Are you looking at Thrift trunk, the thrift package that ships with > phpcassa 0.7.a.3, or the phpcassa master branch? > > > On Wed, Mar 30, 2011 at 2:26 PM, William Oberman > wrote: > >> Nevermind, the header of the file says it's an apache project, so I'll >> contact them. Though, if anyone else is running PHP and is worried about >> dropped connections thrashing their server, apply this patch :-) >> >> >> On Wed, Mar 30, 2011 at 3:18 PM, William Oberman < >> oberman@civicscience.com> wrote: >> >>> I think I found a bug in the cassandra PHP client. I'm using phpcassa, >>> but the bug is in thrift itself, which I think that library phpcassa just >>> wraps. In any case, I was trying to test on my local machine, which has >>> limited RAM, so I reduced the JVM heap size. Of course I immediately had an >>> OOM causing my local cassandra server to crash, but that caused my unit >>> tests to stall at 100% CPU, which seemed weird to me. I had to figure out >>> why. It seems that TSocket doesn't test for EOF (it's only checking for a >>> socket timeout), causing a tight infinite loop when the connection >>> disappears. Checking for EOF in an else if seems like an easy fix, but >>> given how deep this code is in the library I'll leave it to the experts. >>> >>> My diff of the file: >>> @@ -255,6 +255,9 @@ >>> if (true === $md['timed_out'] && false === $md['blocked']) { >>> throw new TTransportException('TSocket: timed out reading >>> '.$len.' bytes from '. >>> $this->host_.':'.$this->port_); >>> + } else if(feof($this->handle_)) { >>> + throw new TTransportException('TSocket: EOF reading '.$len.' >>> bytes from '. >>> + $this->host_.':'.$this->port_); >>> } else { >>> $pre .= $buf; >>> $len -= $sz; >>> >>> >>> -- >>> Will Oberman >>> Civic Science, Inc. >>> 3030 Penn Avenue., First Floor >>> Pittsburgh, PA 15201 >>> (M) 412-480-7835 >>> (E) oberman@civicscience.com >>> >> >> >> >> -- >> Will Oberman >> Civic Science, Inc. >> 3030 Penn Avenue., First Floor >> Pittsburgh, PA 15201 >> (M) 412-480-7835 >> (E) oberman@civicscience.com >> > > > > -- > Tyler Hobbs > Software Engineer, DataStax > Maintainer of the pycassa Cassandra > Python client library > > -- Will Oberman Civic Science, Inc. 3030 Penn Avenue., First Floor Pittsburgh, PA 15201 (M) 412-480-7835 (E) oberman@civicscience.com --00151748e940468c2e049fb83691 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sorry, 0.7.a.3, I was just checking now if my issue still applies in either= new thrift or later phpcassa's.=A0 Probably jumped the gun on emailing= this.

On Wed, Mar 30, 2011 at 3:28 PM, T= yler Hobbs <tyle= r@datastax.com> wrote:
Are you looking a= t Thrift trunk, the thrift package that ships with phpcassa 0.7.a.3, or the= phpcassa master branch?


On Wed, Mar= 30, 2011 at 2:26 PM, William Oberman <oberman@civicscience.com= > wrote:
Nevermind, the he= ader of the file says it's an apache project, so I'll contact them.= =A0 Though, if anyone else is running PHP and is worried about dropped conn= ections thrashing their server, apply this patch :-)


On Wed, Mar 30, 2011 at 3:18 PM, William Oberman= <oberman@civicscience.com> wrote:
I think I found a bug in the cassandra PHP client.=A0 I'm using phpcass= a, but the bug is in thrift itself, which I think that library phpcassa jus= t wraps.=A0 In any case, I was trying to test on my local machine, which ha= s limited RAM, so I reduced the JVM heap size.=A0 Of course I immediately h= ad an OOM causing my local cassandra server to crash, but that caused my un= it tests to stall at 100% CPU, which seemed weird to me.=A0 I had to figure= out why.=A0 It seems that TSocket doesn't test for EOF (it's only = checking for a socket timeout), causing a tight infinite loop when the conn= ection disappears.=A0 Checking for EOF in an else if seems like an easy fix= , but given how deep this code is in the library I'll leave it to the e= xperts.

My diff of the file:
@@ -255,6 +255,9 @@
=A0=A0=A0=A0=A0=A0=A0=A0= if (true =3D=3D=3D $md['timed_out'] && false =3D=3D=3D $md= ['blocked']) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 throw new TTranspo= rtException('TSocket: timed out reading '.$len.' bytes from = 9;.
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 $this->host_.':'.$this->port_);
+=A0=A0= =A0=A0=A0=A0=A0 } else if(feof($this->handle_)) {
+=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 throw new TTransportException('TSocket: EOF reading '.= $len.' bytes from '.
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 $this->host_.':'.$this->port_);
=A0=A0= =A0=A0=A0=A0=A0=A0 } else {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $pre .=3D $bu= f;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $len -=3D $sz;


--
Will Oberman
Civic Science, Inc.
3030 Penn Avenue., First Floor
Pittsburgh, PA 15201
(M) 412-480-7835
(E) oberman@civicscience.com



--
Will Oberman
= Civic Science, Inc.
3030 Penn Avenue., First Floor
Pittsburgh, PA 152= 01
(M) 412-480-7835 (E) oberman@c= ivicscience.com



--
Tyler Hobbs Software Engineer, DataS= tax
Maintainer of the pycassa Cassandra Python client library



--
Will Oberman
= Civic Science, Inc.
3030 Penn Avenue., First Floor
Pittsburgh, PA 152= 01
(M) 412-480-7835
(E) o= berman@civicscience.com
--00151748e940468c2e049fb83691--