From thrift-user-returnfhopkins@example.org Fri May 01 00:57:46 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 75700 invoked from network); 1 May 2009 00:57:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 00:57:46 -0000 Received: (qmail 28696 invoked by uid 500); 1 May 2009 00:57:45 -0000 Delivered-To: fhopkins@example.org Received: (qmail 28655 invoked by uid 500); 1 May 2009 00:57:45 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 28645 invoked by uid 99); 1 May 2009 00:57:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 00:57:45 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO ti-out-0910.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 00:57:33 +0000 Received: by ti-out-0910.google.com with SMTP id u5so210110tia.6 for <fhopkins@example.org>; Thu, 30 Apr 2009 17:57:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=dpYUhyTLd4pkaaXEoSzlL47w9ZJ2GfKVmzUMrYkn4So=; b=DLgR3fs1Q4hrYJTmtYUHLD6jjxWleOSHcmqXjiZQoq4Fm6YgUKpjl4NhxuPKFUkFIq 50gzeI54HDW6pJDJR4X3Mgkd1yN8eZdnvWH58XQyF7/gIvKtf1QE1X2YU5khRVsX+xDJ avO3OHIj7N0Zgl4WrWDFzh+0BqLSlXp5Nv6NY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=FI9/BLpLjQWeNkkUivrgHmUJgVFQ+hswmPdMC/q1sJQ3yrz85h4Aahu+8v6eKpYjaj 7Zf6DsAvpJ3wnkybFxIdFWz7wFAZoWEOcmKneiM46tQcevpE3G3yOdmGtyM/CeEoIQv3 B0BMlkBvVBviGa/FP6B3wnwksfz/95hFfgip8= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id p1mr167468tip.36.1241139432687; Thu, 30 Apr 2009 17:57:12 -0700 (PDT) In-Reply-To: <fhopkins@example.org> References: <fhopkins@example.org> <fhopkins@example.org> <fhopkins@example.org> Date: Fri, 1 May 2009 06:27:12 +0530 Message-ID: <fhopkins@example.org> Subject: Re: Regarding Thrift and Ajax From: Swaroop C H <fhopkins@example.org> To: fhopkins@example.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hello all, Thank you for the different perspectives on this issue. @Dave Engberg Thanks for the JAbsorb link, that is something to consider. I am indeed influenced by the Evernote API on how it works, and it seems like an elegant system. @Ted I completely agree with you, it has been on my mind. *I've been toying with the idea of using OAuth parameters as a first parameter struct to every Thrift call* (Evernote API does this too, but it takes only the access token key). Would this handle some of the authentication issues? Transaction rate limiting, etc. would be separate issues to implement though. Brian has provided some good inputs on that. Thoughts? Regards, Swaroop Books and Blog - http://www.swaroopch.com Company - http://www.ionlab.in On Tue, Apr 28, 2009 at 12:54 AM, Ted Dunning <fhopkins@example.org> wrote= : > Swaroop, > > Thrift is generally best for internal consumption. =A0If you expose an AP= I to > the wild world, you need more than just a JSON translator. =A0You also ne= ed > anti-spoofing measures, transaction rate limits, authentication and input > verification. =A0Raw thrift is really pretty raw and not so long ago, it = was > pretty easy to get an Exception by just sending random bytes to a Thrift > server. > > That said, if *all* you care about is the JSON/Thrift translation, > jabsorb+thrift looks pretty sweet. > > On Mon, Apr 27, 2009 at 10:57 AM, Dave Engberg <fhopkins@example.org>wro= te: > >> >> ... a JavaScript ORB bridge. >> >> >> >> Swaroop C H wrote: >> >>> ... how do people deal with the issue >>> of interaction between Ajax and Thrift-based APIs? >>> ... >>> If the Ajax cannot access the API directly, then a wrapper (that works >>> with Ajax) would have to be written for every single service call. >>> >>> > From thrift-user-returnfhopkins@example.org Mon May 04 10:51:32 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 16762 invoked from network); 4 May 2009 10:51:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 May 2009 10:51:30 -0000 Received: (qmail 56017 invoked by uid 500); 4 May 2009 10:51:29 -0000 Delivered-To: fhopkins@example.org Received: (qmail 55989 invoked by uid 500); 4 May 2009 10:51:29 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 55979 invoked by uid 99); 4 May 2009 10:51:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 10:51:29 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-bw0-f219.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 10:51:22 +0000 Received: by bwz19 with SMTP id 19so4841408bwz.12 for <fhopkins@example.org>; Mon, 04 May 2009 03:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=loAY4lfStfL/e8UCmFRRsYSLq0x8pKQ6dxJwqrSoeMg=; b=aQ/D/0vzs3MNNc/BMsOK71K9kyw0wmCvocR17WfhcSOHm/+XHUCfK6JYli8pOAmOtw cqKBf8hKE24E2Gj/nkWCQ6nCHdOjtLUGsoBbkTFb9yAnqjaCHJhrPXC72NyE1QatIsFM v5QmeRplJcml35pJSHqlISZC8eMvXMs4eB7ic= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=fVS773V0o4icG4EDaS/AHTZ8hLlLg87S5mAGqiFaFemxA1czQQ09evi0i6ZKXTikfP cughFyJmutcZw2YPOr9STg4zdagqoTVLuMx+yrdB8qs0Yj1NdoTnDlKpvWI0WVG3liZl 4/Y45+Et4/yqKV8wJ6ZreQocIkERM1OIKuUm8= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id o4mr5605001bkg.10.1241434260185; Mon, 04 May 2009 03:51:00 -0700 (PDT) In-Reply-To: <fhopkins@example.org> References: <fhopkins@example.org> <fhopkins@example.org> Date: Mon, 4 May 2009 13:51:00 +0300 Message-ID: <fhopkins@example.org> Subject: Re: question about using one transport in both directions From: Yordan Pavlov <fhopkins@example.org> To: fhopkins@example.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Thanks for the help. The thirft community seems to be pretty helpful. However I want to stress everyone's attention on the fact that Thrift's documentation is hard to access and not well structured. As new users come around the mailing lists will get bloated with the same basic questions which everyone would have. I am not pretty sure what the hierarchy in the community is and who should initiate such an activity but I believe that the following should be done: 1) The mailing list archive should be searchable. Starting a forum might be even a better idea since it can structure the topics in sections. 2) The different libraries, their pros and cons and their api should be described in the wiki. I think the wiki format is best for this purpose so that the community can easily edit errors and improvements as they appear. On Tue, Apr 28, 2009 at 9:29 PM, Joel Meyer <fhopkins@example.org> wrote: > > There was a thread called "Using thrift as part of a game network protocol" > that dealt with a similar issue: > > Thread start (in March): > http://mail-archives.apache.org/mod_mbox/incubator-thriftfhopkins@example.org%3e > > Thread continue (in April): > http://mail-archives.apache.org/mod_mbox/incubator-thrift-fhopkins@example.org%3e > > In short (and it's nowhere near being a 'best practice') you could achieve > this using all 'oneway void' messages if you're willing to move the blocking > from the protocol layer into your application layer (or design your app to > use async calls). > > Hope that helps, > Joel > From thrift-user-returnfhopkins@example.org Mon May 04 16:53:51 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 57907 invoked from network); 4 May 2009 16:53:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 May 2009 16:53:51 -0000 Received: (qmail 87256 invoked by uid 500); 4 May 2009 16:53:51 -0000 Delivered-To: fhopkins@example.org Received: (qmail 87227 invoked by uid 500); 4 May 2009 16:53:51 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 87217 invoked by uid 99); 4 May 2009 16:53:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 16:53:50 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-ew0-f172.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 16:53:40 +0000 Received: by ewy20 with SMTP id 20so7032714ewy.12 for <fhopkins@example.org>; Mon, 04 May 2009 09:53:20 -0700 (PDT) MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id i11mr2269767wfj.289.1241455998502; Mon, 04 May 2009 09:53:18 -0700 (PDT) In-Reply-To: <fhopkins@example.org> References: <fhopkins@example.org> <fhopkins@example.org> <fhopkins@example.org> Date: Mon, 4 May 2009 09:53:18 -0700 Message-ID: <fhopkins@example.org> Subject: Re: question about using one transport in both directions From: Jeff Hammerbacher <fhopkins@example.org> To: fhopkins@example.org Content-Type: multipart/alternative; boundary=001636e900e4cb8762046918ff01 X-Virus-Checked: Checked by ClamAV on apache.org --001636e900e4cb8762046918ff01 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hey Yordan, 1) Check out http://thrift.markmail.org to search the thrift mailing lists. 2) It seems like http://wiki.apache.org/thrift/LibraryFeatures is a start for what you're looking to see on the wiki. Given that it is a wiki, you could help fill out the documentation with a skeleton of what you're requesting, perhaps filling in some of it yourself. Later, Jeff On Mon, May 4, 2009 at 3:51 AM, Yordan Pavlov <fhopkins@example.org> wrote: > Thanks for the help. The thirft community seems to be pretty helpful. > However I want to stress everyone's attention on the fact that > Thrift's documentation is hard to access and not well structured. As > new users come around the mailing lists will get bloated with the same > basic questions which everyone would have. I am not pretty sure what > the hierarchy in the community is and who should initiate such an > activity but I believe that the following should be done: > > 1) The mailing list archive should be searchable. Starting a forum > might be even a better idea since it can structure the topics in > sections. > 2) The different libraries, their pros and cons and their api should > be described in the wiki. I think the wiki format is best for this > purpose so that the community can easily edit errors and improvements > as they appear. > > On Tue, Apr 28, 2009 at 9:29 PM, Joel Meyer <fhopkins@example.org> wrote: > > > > There was a thread called "Using thrift as part of a game network > protocol" > > that dealt with a similar issue: > > > > Thread start (in March): > > > http://mail-archives.apache.org/mod_mbox/incubator-thriftfhopkins@example.org%3e > > > > Thread continue (in April): > > > http://mail-archives.apache.org/mod_mbox/incubator-thrift-fhopkins@example.org%3e > > > > In short (and it's nowhere near being a 'best practice') you could > achieve > > this using all 'oneway void' messages if you're willing to move the > blocking > > from the protocol layer into your application layer (or design your app > to > > use async calls). > > > > Hope that helps, > > Joel > > > --001636e900e4cb8762046918ff01-- From thrift-user-returnfhopkins@example.org Mon May 04 18:20:49 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 12049 invoked from network); 4 May 2009 18:20:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 May 2009 18:20:45 -0000 Received: (qmail 26033 invoked by uid 500); 4 May 2009 18:20:45 -0000 Delivered-To: fhopkins@example.org Received: (qmail 26010 invoked by uid 500); 4 May 2009 18:20:45 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 25996 invoked by uid 99); 4 May 2009 18:20:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 18:20:45 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-gx0-f177.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 18:20:37 +0000 Received: by gxk25 with SMTP id 25so7025363gxk.12 for <fhopkins@example.org>; Mon, 04 May 2009 11:20:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=V9InrXr8oeZyaW/x7pLLe3dn/mKO8xsFQP5e4FN1VWc=; b=oamhVkg52rZBP69e1ssxmobDQVovWSE8R0VQndp56FzpOqH2krqe67Q851xBBfUcph pLP1oyLw5qKTYqNs/aLFRsyqjN9lM8b0IXU6e8QUPB9o3M5GYaX+aBVNG2ftaTb1Gcl8 WMk38qaFoTyXQUYcAThX6JVr8RhKsHOgq1Hds= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=VMzP2o0vyaGxJ2WxGAWZKiCOIWX/Q9hO5VI5nUDaBSgomRrnxRRB0Vh3rEQSfKcWUK +Pvj9WOILRbl/eRGZ0REugfQbKdPPgb28rCBPcvm1QYdq268TwP7ohKPFX1D8WGNj/OH 11LehpNEI24mcUFvv4F8zlJWGwDGV8xC8y5Ag= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id z5mr12599144ybk.78.1241461210092; Mon, 04 May 2009 11:20:10 -0700 (PDT) In-Reply-To: <fhopkins@example.org> References: <fhopkins@example.org> <fhopkins@example.org> <fhopkins@example.org> From: Ted Dunning <fhopkins@example.org> Date: Mon, 4 May 2009 11:19:55 -0700 Message-ID: <fhopkins@example.org> Subject: Re: question about using one transport in both directions To: fhopkins@example.org Content-Type: multipart/alternative; boundary=001e680f10206e146804691a36ba X-Virus-Checked: Checked by ClamAV on apache.org --001e680f10206e146804691a36ba Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hear, hear. I would second this point. It isn't like there is all that much to document (at the first level). >From the user's point of view, using thrift is remarkably easy and clean. Getting to that point of enlightenment, however, is not easy. On Mon, May 4, 2009 at 3:51 AM, Yordan Pavlov <fhopkins@example.org> wrote: > However I want to stress everyone's attention on the fact that > Thrift's documentation is hard to access and not well structured. > -- Ted Dunning, CTO DeepDyve --001e680f10206e146804691a36ba-- From thrift-user-returnfhopkins@example.org Tue May 05 20:54:43 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 51137 invoked from network); 5 May 2009 20:54:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 May 2009 20:54:42 -0000 Received: (qmail 78649 invoked by uid 500); 5 May 2009 20:54:42 -0000 Delivered-To: fhopkins@example.org Received: (qmail 78449 invoked by uid 500); 5 May 2009 20:54:41 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 78436 invoked by uid 99); 5 May 2009 20:54:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 20:54:41 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-fx0-f220.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 20:54:33 +0000 Received: by fxm20 with SMTP id 20so6391668fxm.12 for <fhopkins@example.org>; Tue, 05 May 2009 13:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=vUv8GBc0fQ0gpSaDYfwuUIDcG/jALszJL0dNdt3rUVk=; b=rlRiOD0rIXWaDMuMRJldbOd55Wuzk/fw/KcS8vX+A1YynTNk5UO3yiDXXeA8q44LRm HpgCB5SWRhP3a7Ka0LisnpYloZFni9I8yrCO+pv1ZuvjAIeMW9Cae6vntQ4072lEDYP2 HGtT/kIXu7fDRO9/Ea3Jr5podxgnlBWiafFD4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=NSdIGDF18w3UaK+Nh1DdGHkgxmzUBTLhSJoVMnKyyo3ax4r+X4D/dOv5Holf79euy9 18QRRVqfxlBBVQTkPUQqJCR3H0VFdKWg6+npOS3g7XwfWpQG6KCMTyuXYFqU8RGmj90W 92HFXA76kGq+sMxw5GPwqvv+FAlTEEI7QrT1M= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id i11mr415639bkq.199.1241556852645; Tue, 05 May 2009 13:54:12 -0700 (PDT) Reply-To: fhopkins@example.org Date: Tue, 5 May 2009 21:54:12 +0100 Message-ID: <fhopkins@example.org> Subject: Two way RPC & Encryption From: Charles Mason <fhopkins@example.org> To: fhopkins@example.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi All, I was wondering is it possible to have two way RPC style communication over a single Thrift transport. What I mean is say the client connects to the server and calls a few service functions, then later whilst the connection is still open the server wants to call a service on the client. I have a need to occasionally push notifications to the client and I would rather not have the client polling from them as they may only happen every few hours and I really need the client to respond to the push in a few seconds. Also is it possible to make the transport connections stateful. In a previous generation of the my app it would store connection sate info such as an authenticated role. Then any future connection would check the authentication before continuing. I realize I could pass some sort of token back and forth with every call but thats hardly efficient if the token is sufficiently large to be secure. Finally has anyone produced an encrypted transport for Thrift. I imagine it should be relatively easy once you have the securely negotiated the session key, it should be possible just to split the stream into blocks and run them through a block cipher like AES. The only slight complication would be padding out the block to make sure its alway of the correct size. Has anyone tried this already ? Thanks Charlie M From thrift-user-returnfhopkins@example.org Wed May 06 16:50:05 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 43392 invoked from network); 6 May 2009 16:50:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 16:50:02 -0000 Received: (qmail 16459 invoked by uid 500); 6 May 2009 16:49:58 -0000 Delivered-To: fhopkins@example.org Received: (qmail 15971 invoked by uid 500); 6 May 2009 16:49:56 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 15567 invoked by uid 99); 6 May 2009 16:49:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 16:49:55 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=MSGID_FROM_MTA_HEADER,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO asmtpout011.mac.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 16:42:17 +0000 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=ISO-8859-1 Received: from spool001.mac.com ([83.161.120.155]) by asmtp011.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTP id <fhopkins@example.org> for fhopkins@example.org; Wed, 06 May 2009 09:38:05 -0700 (PDT) Received: from webmail044 ([83.161.120.155]) by spool001.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTP id <fhopkins@example.org> for fhopkins@example.org; Wed, 06 May 2009 09:37:21 -0700 (PDT) Date: Wed, 06 May 2009 18:37:21 +0200 From: Patrick Schlangen <fhopkins@example.org> To: fhopkins@example.org Message-id: <fhopkins@example.org> Subject: Client IP address Received: from [83.161.120.155] from webmail.me.com with HTTP; Wed, 06 May 2009 18:37:21 +0200 Received: from [ 83.161.120.155] from webmail.me.com with HTTP; Wed, 06 May 2009 18:37:21 +0200 X-Originating-IP: 83.161.120.155, 83.161.120.155 X-Virus-Checked: Checked by ClamAV on apache.org Hi, I am implementing a thrift-based service in C++ at the moment and encountered a question: Is there a way to get the client's IP address from inside a service method implementation? I am using a TThreadedServer. Thanks in advance! Patrick Schlangen From thrift-user-returnfhopkins@example.org Wed May 06 17:17:51 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 57662 invoked from network); 6 May 2009 17:17:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 17:17:50 -0000 Received: (qmail 1464 invoked by uid 500); 6 May 2009 17:17:50 -0000 Delivered-To: fhopkins@example.org Received: (qmail 1452 invoked by uid 500); 6 May 2009 17:17:50 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 1442 invoked by uid 99); 6 May 2009 17:17:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 17:17:50 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail.rapleaf.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 17:17:40 +0000 Received: from mail.rapleaf.com (localhost.localdomain [83.161.120.155]) by mail.rapleaf.com (Postfix) with ESMTP id 22BAE1250179 for <fhopkins@example.org>; Wed, 6 May 2009 10:17:20 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=rapleaf.com; q=dns; s=m1; b=TKPzl YST7VV6KFDWFQsbNX/yKXtu1+dIciWojciwzxcGSdJaIzo1qjJdV5gzhRRpAO72G ZcjTc16Hk1/1UpV5RbZP4lP+WLs269PIcrsPnzaKzkuHfTf/Ua1qp7u7DHo7wxYF +pub8pij4HB1mY5P3QVSknKns6x+xrBNA69jvg= Received: from [83.161.120.155] (unknown [83.161.120.155]) by mail.rapleaf.com (Postfix) with ESMTP id 0E50A12500A7 for <fhopkins@example.org>; Wed, 6 May 2009 10:17:20 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v753.1) In-Reply-To: <fhopkins@example.org> References: <fhopkins@example.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <fhopkins@example.org> Content-Transfer-Encoding: 7bit From: Bryan Duxbury <fhopkins@example.org> Subject: Re: Client IP address Date: Wed, 6 May 2009 10:17:28 -0700 To: fhopkins@example.org X-Mailer: Apple Mail (2.753.1) X-Virus-Checked: Checked by ClamAV on apache.org We don't currently have a way to do this, though it has been discussed. The best bet as of right now is to add a parameter to the service method that takes the client address and have the client report it itself. -Bryan On May 6, 2009, at 9:37 AM, Patrick Schlangen wrote: > Hi, > > I am implementing a thrift-based service in C++ at the moment and > encountered a question: > > Is there a way to get the client's IP address from inside a service > method implementation? I am using a TThreadedServer. > > Thanks in advance! > > Patrick Schlangen > > From thrift-user-returnfhopkins@example.org Wed May 06 17:22:30 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 60913 invoked from network); 6 May 2009 17:22:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 17:22:30 -0000 Received: (qmail 10501 invoked by uid 500); 6 May 2009 17:22:30 -0000 Delivered-To: fhopkins@example.org Received: (qmail 10485 invoked by uid 500); 6 May 2009 17:22:30 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 10475 invoked by uid 99); 6 May 2009 17:22:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 17:22:30 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=MSGID_FROM_MTA_HEADER,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO asmtpout012.mac.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 17:22:20 +0000 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=ISO-8859-1 Received: from spool003.mac.com ([83.161.120.155]) by asmtp012.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTP id <fhopkins@example.org> for fhopkins@example.org; Wed, 06 May 2009 10:21:14 -0700 (PDT) Received: from webmail044 ([83.161.120.155]) by spool003.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTP id <fhopkins@example.org> for fhopkins@example.org; Wed, 06 May 2009 10:21:08 -0700 (PDT) Date: Wed, 06 May 2009 19:21:08 +0200 From: Patrick Schlangen <fhopkins@example.org> To: fhopkins@example.org Message-id: <fhopkins@example.org> In-reply-to: <fhopkins@example.org> References: <fhopkins@example.org> <fhopkins@example.org> Subject: AW: Re: Client IP address Received: from [83.161.120.155] from webmail.me.com with HTTP; Wed, 06 May 2009 19:21:08 +0200 Received: from [ 83.161.120.155] from webmail.me.com with HTTP; Wed, 06 May 2009 19:21:08 +0200 X-Originating-IP: 83.161.120.155, 83.161.120.155 X-Virus-Checked: Checked by ClamAV on apache.org Thank you for your response. That leads me to new problems as the client is not aware of it's own (public) IP address as it is behind a NAT router. I will think about a way to solve this. Patrick Am Mittwoch 06 Mai 2009 um 07:17PM schrieb "Bryan Duxbury" <fhopkins@example.org>: >We don't currently have a way to do this, though it has been >discussed. The best bet as of right now is to add a parameter to the >service method that takes the client address and have the client >report it itself. > >-Bryan > From thrift-user-returnfhopkins@example.org Wed May 06 17:56:15 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 79989 invoked from network); 6 May 2009 17:56:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 17:56:14 -0000 Received: (qmail 63648 invoked by uid 500); 6 May 2009 17:56:14 -0000 Delivered-To: fhopkins@example.org Received: (qmail 63611 invoked by uid 500); 6 May 2009 17:56:14 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 63600 invoked by uid 99); 6 May 2009 17:56:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 17:56:14 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-bw0-f171.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 17:56:06 +0000 Received: by bwz19 with SMTP id 19so291080bwz.12 for <fhopkins@example.org>; Wed, 06 May 2009 10:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=W1mwmyHyzxlOF9b3Rd3TNp8NXt6+TTdS739q1fj79Lg=; b=YUgDUM0NrBdpSSGp/0hw1fBL+obm+KGexqwHG2cUGHQjqOeTiZLg6l6mIVoCqAa/pr JOmm4M/osEAImYeVr1CGcYLnFQOsJO6hDgou0v1NliANxZutcDDHEL2JYH/StmNi43tx fXIoTRXmDRoWtgiHrVu60whkB8bm1uPf4awEo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=pSl9eyee81kFLFI7avoMBAxU34HVxVfwBVnXRib8VbLG6vEgtW4oeVUH7IkatIA+Lr Sr3Krd+ePj4em+FCqQhpgv63YC8oKnJrMwRgug+UhQCOjMDAgItPC4yQ0tLceWZJow2H f3UbLTFKDtZ+DFFk4wqmZfjB4WWE1FvZjmtQs= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id w2mr1133537fap.65.1241632545406; Wed, 06 May 2009 10:55:45 -0700 (PDT) In-Reply-To: <fhopkins@example.org> References: <fhopkins@example.org> Date: Wed, 6 May 2009 18:55:45 +0100 Message-ID: <fhopkins@example.org> Subject: Re: Client IP address From: Carlos Valiente <fhopkins@example.org> To: fhopkins@example.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org > I am implementing a thrift-based service in C++ at the moment and encountered a question: > > Is there a way to get the client's IP address from inside a service method implementation? I am using a TThreadedServer. On Java, the trick is to keep a reference to the Thrift transport object in your service implementation. See http://tinyurl.com/djv4m6, http://tinyurl.com/c7oj2v and http://tinyurl.com/ddjjkb --- I managed to achieve that by using a custom protocl factory. C From thrift-user-returnfhopkins@example.org Wed May 06 18:15:13 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 92735 invoked from network); 6 May 2009 18:15:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 18:15:12 -0000 Received: (qmail 93783 invoked by uid 500); 6 May 2009 18:15:12 -0000 Delivered-To: fhopkins@example.org Received: (qmail 93729 invoked by uid 500); 6 May 2009 18:15:11 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 93719 invoked by uid 99); 6 May 2009 18:15:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 18:15:11 +0000 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=RCVD_IN_BL_SPAMCOP_NET,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO fk-out-0910.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 18:15:02 +0000 Received: by fk-out-0910.google.com with SMTP id z22so137999fkz.12 for <fhopkins@example.org>; Wed, 06 May 2009 11:14:39 -0700 (PDT) Received: by 83.161.120.155 with SMTP id k8mr1482698bkq.110.1241633679263; Wed, 06 May 2009 11:14:39 -0700 (PDT) Received: from ?83.161.120.155? (772)547-0284.adsl.inetia.pl [83.161.120.155]) by mx.google.com with ESMTPS id f31sm13607065fkf.12.283.161.120.155.14.38 (version=SSLv3 cipher=RC4-MD5); Wed, 06 May 2009 11:14:38 -0700 (PDT) Message-Id: <fhopkins@example.org> From: Krzysztof Godlewski <fhopkins@example.org> To: fhopkins@example.org In-Reply-To: <fhopkins@example.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Client IP address Date: Wed, 6 May 2009 20:14:51 +0200 References: <fhopkins@example.org> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org On 2009-05-06, at 18:37, Patrick Schlangen wrote: > Hi, > > I am implementing a thrift-based service in C++ at the moment and > encountered a question: > > Is there a way to get the client's IP address from inside a service > method implementation? I am using a TThreadedServer. I implemented this using TServerEventHandler: * there's a static map that holds client addrs: map<unsigned long, string> * client addresses are added to a map in MyHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lientBegin(), pthread_self() is the key in address map * addresses are removed in clientEnd() * a static method MyHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4get() returns addresses[pthread_self()] I know, it's a very primitive solution, but it works :) From thrift-user-returnfhopkins@example.org Wed May 06 19:01:48 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 19712 invoked from network); 6 May 2009 19:01:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 19:01:48 -0000 Received: (qmail 85224 invoked by uid 500); 6 May 2009 19:01:48 -0000 Delivered-To: fhopkins@example.org Received: (qmail 85191 invoked by uid 500); 6 May 2009 19:01:47 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 85181 invoked by uid 99); 6 May 2009 19:01:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 19:01:47 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=MSGID_FROM_MTA_HEADER,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO asmtpout011.mac.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 19:01:37 +0000 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=ISO-8859-1 Received: from spool002.mac.com ([83.161.120.155]) by asmtp011.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTP id <fhopkins@example.org> for fhopkins@example.org; Wed, 06 May 2009 12:01:16 -0700 (PDT) Received: from webmail044 ([83.161.120.155]) by spool002.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTP id <fhopkins@example.org> for fhopkins@example.org; Wed, 06 May 2009 12:01:09 -0700 (PDT) Date: Wed, 06 May 2009 21:01:09 +0200 From: Patrick Schlangen <fhopkins@example.org> To: fhopkins@example.org Message-id: <fhopkins@example.org> In-reply-to: <fhopkins@example.org> References: <fhopkins@example.org> <fhopkins@example.org> Subject: AW: Re: Client IP address Received: from [83.161.120.155] from webmail.me.com with HTTP; Wed, 06 May 2009 21:01:09 +0200 Received: from [ 83.161.120.155] from webmail.me.com with HTTP; Wed, 06 May 2009 21:01:09 +0200 X-Originating-IP: 83.161.120.155, 83.161.120.155 X-Virus-Checked: Checked by ClamAV on apache.org Am Mittwoch 06 Mai 2009 um 08:14PM schrieb "Krzysztof Godlewski" <fhopkins@example.org>: >I implemented this using TServerEventHandler: > * there's a static map that holds client addrs: map<unsigned long, >string> > * client addresses are added to a map in MyHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lientBegin(), >pthread_self() is the key in address map That sounds like a great idea. But how do you get the client's IP in clientBegin()? I tried to cast the input or output parameter to a TSocket and call getPeerAddress() but it returns an empty string only. Patrick From thrift-user-returnfhopkins@example.org Wed May 06 19:36:03 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 29065 invoked from network); 6 May 2009 19:36:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 19:36:03 -0000 Received: (qmail 55198 invoked by uid 500); 6 May 2009 19:36:03 -0000 Delivered-To: fhopkins@example.org Received: (qmail 54988 invoked by uid 500); 6 May 2009 19:36:02 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 54978 invoked by uid 99); 6 May 2009 19:36:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 19:36:02 +0000 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=RCVD_IN_BL_SPAMCOP_NET,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO fg-out-1718.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 19:35:53 +0000 Received: by fg-out-1718.google.com with SMTP id l27so1618457fgb.3 for <fhopkins@example.org>; Wed, 06 May 2009 12:35:11 -0700 (PDT) Received: by 83.161.120.155 with SMTP id h2mr1655885fga.30.1241638511171; Wed, 06 May 2009 12:35:11 -0700 (PDT) Received: from ?83.161.120.155? (772)547-0284.adsl.inetia.pl [83.161.120.155]) by mx.google.com with ESMTPS id 12sm12261919fgg.15.283.161.120.155.35.10 (version=SSLv3 cipher=RC4-MD5); Wed, 06 May 2009 12:35:10 -0700 (PDT) Message-Id: <fhopkins@example.org> From: Krzysztof Godlewski <fhopkins@example.org> To: fhopkins@example.org In-Reply-To: <fhopkins@example.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: AW: Re: Client IP address Date: Wed, 6 May 2009 21:35:26 +0200 References: <fhopkins@example.org> <fhopkins@example.org> <fhopkins@example.org> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org On 2009-05-06, at 21:01, Patrick Schlangen wrote: >> I implemented this using TServerEventHandler: >> * there's a static map that holds client addrs: map<unsigned long, >> string> >> * client addresses are added to a map in MyHandler888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4lientBegin(), >> pthread_self() is the key in address map > > That sounds like a great idea. But how do you get the client's IP in > clientBegin()? > I tried to cast the input or output parameter to a TSocket and call > getPeerAddress() but it returns an empty string only. This should work, more or less. I omited checks for nulls, locking, etc. TBufferedTransport *tbuf = dynamic_cast<TBufferedTransport *>(input- >getTransport().get()); TSocket *sock = dynamic_cast<TSocket *>(tbuf- >getUnderlyingTransport().get()); addrs[pthread_self()] = sock->getPeerAddress(); From thrift-user-returnfhopkins@example.org Wed May 06 20:04:36 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 35997 invoked from network); 6 May 2009 20:04:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 20:04:36 -0000 Received: (qmail 99835 invoked by uid 500); 6 May 2009 20:04:35 -0000 Delivered-To: fhopkins@example.org Received: (qmail 99808 invoked by uid 500); 6 May 2009 20:04:35 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 99798 invoked by uid 99); 6 May 2009 20:04:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 20:04:35 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=MSGID_FROM_MTA_HEADER,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO asmtpout014.mac.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 20:04:25 +0000 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=ISO-8859-1 Received: from spool003.mac.com ([83.161.120.155]) by asmtp014.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTP id <fhopkins@example.org> for fhopkins@example.org; Wed, 06 May 2009 13:04:04 -0700 (PDT) Received: from webmail044 ([83.161.120.155]) by spool003.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTP id <fhopkins@example.org> for fhopkins@example.org; Wed, 06 May 2009 13:03:48 -0700 (PDT) Date: Wed, 06 May 2009 22:03:48 +0200 From: Patrick Schlangen <fhopkins@example.org> To: fhopkins@example.org Message-id: <fhopkins@example.org> In-reply-to: <fhopkins@example.org> References: <fhopkins@example.org> <fhopkins@example.org> <fhopkins@example.org> <fhopkins@example.org> Subject: AW: Re: AW: Re: Client IP address Received: from [83.161.120.155] from webmail.me.com with HTTP; Wed, 06 May 2009 22:03:48 +0200 Received: from [ 83.161.120.155] from webmail.me.com with HTTP; Wed, 06 May 2009 22:03:48 +0200 X-Originating-IP: 83.161.120.155, 83.161.120.155 X-Virus-Checked: Checked by ClamAV on apache.org Am Mittwoch 06 Mai 2009 um 09:35PM schrieb "Krzysztof Godlewski" <fhopkins@example.org>: >This should work, more or less. I omited checks for nulls, locking, etc. > (...) Thank you so much, it works! Patrick From thrift-user-returnfhopkins@example.org Wed May 06 22:04:18 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 85693 invoked from network); 6 May 2009 22:04:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 22:04:18 -0000 Received: (qmail 96111 invoked by uid 500); 6 May 2009 22:04:17 -0000 Delivered-To: fhopkins@example.org Received: (qmail 96066 invoked by uid 500); 6 May 2009 22:04:17 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 96056 invoked by uid 99); 6 May 2009 22:04:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 22:04:17 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO qw-out-1920.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 22:04:09 +0000 Received: by qw-out-1920.google.com with SMTP id 9so310199qwj.54 for <fhopkins@example.org>; Wed, 06 May 2009 15:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=lLflndMLURd7A6wuS4NhFtKCfIm3y93/OgEHyMPvQek=; b=F3rFPURq3XYn7ogLKwt8B+eHzl7KDL+F6GPu0FTidO8h9NwLMWJQg+4KQyFCUcMizD yQDX2uvvBizlXCHY41RaCjeYmRUdFV0fh0pVssyUQcoGYlsvO2KtuCJnJU/onZWZ3MTQ G4X0nBPOawh85TX/WoJOmkeqp8GBycHqVvn+s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=UG14IMqn3aW2h7WWWvhmL/1TAAF9lEA4QVB05YLkEfFnnXtCrQ5RmRm3mP5Z6V/mR1 jb7yOdx9mDIWseb2J6wYrSm24eDm4+LqM9wm6lGlgsCXte5fZbB1BTIqnQ64wEG0eiPI 8/YL2d5rEPcqaTYWRHGg75zulm/Kxbcfo78r8= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id f6mr1593909qcn.81.1241647428089; Wed, 06 May 2009 15:03:48 -0700 (PDT) From: Curtis Spencer <fhopkins@example.org> Date: Wed, 6 May 2009 22:01:45 +0000 Message-ID: <fhopkins@example.org> Subject: Help Debugging Periodic Error To: fhopkins@example.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, First message to the thrift list. Thanks for releasing such a great technology. I have been mainly using the C++ versions of client and server, but I have been rarely encountering a problem that I don't really have much data to help discern. I wanted to see if this is something others had encountered and whether or not I am doing something silly. The problem I see is that my application servers (which are the clients to a thrift service) periodically hang. I can restart the thrift service and the application servers (without restart) are happy again. The only output I see is at the thrift service level and what I get is this: TServerTransport died on accept: Called write on non-open socket Thrift: Wed May 6 09:30:07 2009 TSocket888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4write() send() <Host: Port: 0>Broken pipe TSimpleServer client died: write() send(): Broken pipe TServerTransport died on accept: Called write on non-open socket Thrift: Wed May 6 09:30:07 2009 TSocket888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4write() send() <Host: Port: 0>Broken pipe TSimpleServer client died: write() send(): Broken pipe TServerTransport died on accept: Called write on non-open socket Thrift: Wed May 6 09:30:07 2009 TSocket888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4write() send() <Host: Port: 0>Broken pipe TSimpleServer client died: write() send(): Broken pipe TServerTransport died on accept: Called write on non-open socket Thrift: Wed May 6 09:30:07 2009 TSocket888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4write() send() <Host: Port: 0>Broken pipe TSimpleServer client died: write() send(): Broken pipe TServerTransport died on accept: Called write on non-open socket Thrift: Wed May 6 09:30:07 2009 TSocket888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4write() send() <Host: Port: 0>Broken pipe TSimpleServer client died: write() send(): Broken pipe TServerTransport died on accept: Called write on non-open socket TSimpleServer client died: No more data to read. For the next time I see it happen, I now have them both running with debug symbols so i will attach to them with gdb and see exactly where they are at, so I can add more information to this thread. As for the client/server code, my server looks pretty cookie cutter: int main(int argc, char **argv) { int port = 9092; shared_ptr<MyHandler> handler(new MyHandler()); shared_ptr<TProcessor> processor(new MyProcessor(handler)); shared_ptr<TServerTransport> serverTransport(new TServerSocket(port)); shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory()); shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory()); TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory); server.serve(); return 0; } My client that does the connection is: shared_ptr<TSocket> socket(new TSocket(host_name,port))); socket->setConnTimeout(THRIFT_TIMEOUT); // Which Equals 10000 socket->setRecvTimeout(THRIFT_TIMEOUT); shared_ptr<TTransport> transport(new TBufferedTransport(socket)); shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport)); MyClient client(protocol); try { transport->open(); client.mycall(results); transport->close(); } catch (TException &tx) { cerr << "Caught Exception" << endl; } Anything look fishy there? Thanks in advance, Curtis From thrift-user-returnfhopkins@example.org Wed May 06 22:08:36 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 88301 invoked from network); 6 May 2009 22:08:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 22:08:35 -0000 Received: (qmail 1033 invoked by uid 500); 6 May 2009 22:08:35 -0000 Delivered-To: fhopkins@example.org Received: (qmail 1018 invoked by uid 500); 6 May 2009 22:08:35 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 1007 invoked by uid 99); 6 May 2009 22:08:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 22:08:35 +0000 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mailout-snc1.facebook.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 22:08:27 +0000 Received: from mail.thefacebook.com (intlb01.snat.snc1.facebook.com [83.161.120.155] (may be forged)) by pp-master.snc1.tfbnw.net (8.14.1/8.14.1) with ESMTP id n46M83mx011058 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for <fhopkins@example.org>; Wed, 6 May 2009 15:08:03 -0700 Received: from [83.161.120.155] (83.161.120.155) by mail.TheFacebook.com (83.161.120.155) with Microsoft SMTP Server (TLS) id 8.1.358.0; Wed, 6 May 2009 15:08:04 -0700 Message-ID: <fhopkins@example.org> Date: Wed, 6 May 2009 15:08:03 -0700 From: David Reiss <fhopkins@example.org> User-Agent: Thunderbird 83.161.120.155 (X11/20090409) MIME-Version: 1.0 To: "fhopkins@example.org" <fhopkins@example.org> Subject: Re: Help Debugging Periodic Error References: <fhopkins@example.org> In-Reply-To: <fhopkins@example.org> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.7400:2.4.4,1.2.40,4.0.166 definitions=2009-05-07_01:2009-04-28,2009-05-06,2009-05-06 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0811170000 definitions=main-0905060186 X-Virus-Checked: Checked by ClamAV on apache.org Looks pretty standard. I'd be interested to see where the client is hanging. It doesn't seem likely, but maybe it is during the send? You could try setting a send timeout. --David Curtis Spencer wrote: > Hi, > > First message to the thrift list. Thanks for releasing such a great > technology. > > I have been mainly using the C++ versions of client and server, but I > have been rarely encountering a problem that I don't really have much > data to help discern. > I wanted to see if this is something others had encountered and > whether or not I am doing something silly. > > The problem I see is that my application servers (which are the > clients to a thrift service) periodically hang. I can restart the > thrift service and the application servers (without restart) are happy > again. > > The only output I see is at the thrift service level and what I get is this: > > TServerTransport died on accept: Called write on non-open socket > Thrift: Wed May 6 09:30:07 2009 TSocket888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4write() send() <Host: Port: > 0>Broken pipe > TSimpleServer client died: write() send(): Broken pipe > TServerTransport died on accept: Called write on non-open socket > Thrift: Wed May 6 09:30:07 2009 TSocket888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4write() send() <Host: Port: > 0>Broken pipe > TSimpleServer client died: write() send(): Broken pipe > TServerTransport died on accept: Called write on non-open socket > Thrift: Wed May 6 09:30:07 2009 TSocket888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4write() send() <Host: Port: > 0>Broken pipe > TSimpleServer client died: write() send(): Broken pipe > TServerTransport died on accept: Called write on non-open socket > Thrift: Wed May 6 09:30:07 2009 TSocket888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4write() send() <Host: Port: > 0>Broken pipe > TSimpleServer client died: write() send(): Broken pipe > TServerTransport died on accept: Called write on non-open socket > Thrift: Wed May 6 09:30:07 2009 TSocket888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4write() send() <Host: Port: > 0>Broken pipe > TSimpleServer client died: write() send(): Broken pipe > TServerTransport died on accept: Called write on non-open socket > TSimpleServer client died: No more data to read. > > For the next time I see it happen, I now have them both running with > debug symbols so i will attach to them with gdb and see exactly where > they are at, so I can add more information to this thread. > > As for the client/server code, my server looks pretty cookie cutter: > > int main(int argc, char **argv) { > int port = 9092; > shared_ptr<MyHandler> handler(new MyHandler()); > shared_ptr<TProcessor> processor(new MyProcessor(handler)); > shared_ptr<TServerTransport> serverTransport(new TServerSocket(port)); > shared_ptr<TTransportFactory> transportFactory(new > TBufferedTransportFactory()); > shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory()); > > TSimpleServer server(processor, serverTransport, transportFactory, > protocolFactory); > server.serve(); > return 0; > } > > My client that does the connection is: > > shared_ptr<TSocket> socket(new TSocket(host_name,port))); > socket->setConnTimeout(THRIFT_TIMEOUT); // Which Equals 10000 > socket->setRecvTimeout(THRIFT_TIMEOUT); > shared_ptr<TTransport> transport(new TBufferedTransport(socket)); > shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport)); > MyClient client(protocol); > try { > transport->open(); > client.mycall(results); > transport->close(); > } catch (TException &tx) { > cerr << "Caught Exception" << endl; > } > > > Anything look fishy there? > > Thanks in advance, > Curtis From thrift-user-returnfhopkins@example.org Wed May 06 22:10:21 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 89115 invoked from network); 6 May 2009 22:10:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 22:10:21 -0000 Received: (qmail 2187 invoked by uid 500); 6 May 2009 22:10:21 -0000 Delivered-To: fhopkins@example.org Received: (qmail 2169 invoked by uid 500); 6 May 2009 22:10:21 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 2159 invoked by uid 99); 6 May 2009 22:10:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 22:10:21 +0000 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-fx0-f172.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 22:10:11 +0000 Received: by fxm20 with SMTP id 20so426753fxm.12 for <fhopkins@example.org>; Wed, 06 May 2009 15:09:51 -0700 (PDT) Received: by 83.161.120.155 with SMTP id f7mr1163719mur.130.1241647790985; Wed, 06 May 2009 15:09:50 -0700 (PDT) Received: from ?83.161.120.155? (772)547-0284.adsl.inetia.pl [83.161.120.155]) by mx.google.com with ESMTPS id y2sm63225mug.13.283.161.120.155.09.50 (version=SSLv3 cipher=RC4-MD5); Wed, 06 May 2009 15:09:50 -0700 (PDT) Message-Id: <fhopkins@example.org> From: Krzysztof Godlewski <fhopkins@example.org> To: fhopkins@example.org In-Reply-To: <fhopkins@example.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Help Debugging Periodic Error Date: Thu, 7 May 2009 00:10:08 +0200 References: <fhopkins@example.org> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org On 2009-05-07, at 00:01, Curtis Spencer wrote: > Anything look fishy there? Blind guess: file descriptor limit reached? From thrift-user-returnfhopkins@example.org Wed May 06 23:16:57 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 13233 invoked from network); 6 May 2009 23:16:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 23:16:56 -0000 Received: (qmail 70059 invoked by uid 500); 6 May 2009 23:16:56 -0000 Delivered-To: fhopkins@example.org Received: (qmail 70034 invoked by uid 500); 6 May 2009 23:16:56 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 70024 invoked by uid 99); 6 May 2009 23:16:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 23:16:55 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO qw-out-1920.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 23:16:47 +0000 Received: by qw-out-1920.google.com with SMTP id 9so333984qwj.54 for <fhopkins@example.org>; Wed, 06 May 2009 16:16:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=/AU9V2BmBi+v5KQ/7P2Cc0m1KiWeFhA+DBDYqayZv7Y=; b=mjhTqpXRLU50zWuBJCylGb8uFRl1JHtujpdAKSm0U9TF4yzUMXCfZSVuyMax4mpzxk IGcruJtrmVnXE2smyEUsd2383ejA5TNpSUCHM2dbQTtZt1iJFN20twGICBodugAjbfo5 59zPp6VVilJSNzoaUSe0Q9HpBmAFrnjdxIbpo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=HO9b56eOsa4fxBhzf7EZem/wXgXFiR00ib+ww7+t1eFD4vtHnHrcIu3d8QAUhRHR9+ GvpqonbZpZX/JNKtyAs4LWkQnjn6E1IjqlvJ+9shlInluK2eOMksI8/GTrf0wHlO29lb akRYJOs6EOI1yIZTuBfhBvsCEPteUqJNh9pIM= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id f9mr1703791qcn.78.1241651787140; Wed, 06 May 2009 16:16:27 -0700 (PDT) In-Reply-To: <fhopkins@example.org> References: <fhopkins@example.org> <fhopkins@example.org> From: Curtis Spencer <fhopkins@example.org> Date: Wed, 6 May 2009 23:16:07 +0000 Message-ID: <fhopkins@example.org> Subject: Re: Help Debugging Periodic Error To: fhopkins@example.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Wed, May 6, 2009 at 10:10 PM, Krzysztof Godlewski <fhopkins@example.org> wrote: > > On 2009-05-07, at 00:01, Curtis Spencer wrote: > >> Anything look fishy there? > > Blind guess: file descriptor limit reached? > @David I will just watch the problem and next time it exhibits, see where it does hang. Doesn't happen all that often. Just the most opportune times such as tech demos ;-). The send timeout may be the ticket. @Krzysztof I have ulimit => unlimited, so I doubt it is the problem. Is there any way to ascertain whether or not it is encountering a file descriptor limit? Also, one other thing I ought to mention is that I have never seen it happen when the service is under a heavy load. Usually when a first request after a lull period or after a deploy. -Curtis From thrift-user-returnfhopkins@example.org Wed May 06 23:29:09 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 15498 invoked from network); 6 May 2009 23:29:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 May 2009 23:29:09 -0000 Received: (qmail 81955 invoked by uid 500); 6 May 2009 23:29:09 -0000 Delivered-To: fhopkins@example.org Received: (qmail 81938 invoked by uid 500); 6 May 2009 23:29:08 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 81928 invoked by uid 99); 6 May 2009 23:29:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 23:29:08 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO yw-out-1718.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 23:29:00 +0000 Received: by yw-out-1718.google.com with SMTP id 5so256375ywr.0 for <fhopkins@example.org>; Wed, 06 May 2009 16:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=gWnexjbWSyfZ0PQ5NJhNwayE1wJtaeQGsTfAa9CRO6c=; b=x64raqDyemQwBhGP1bIwINIu0pFB6e7xVOiPysXSG2ZlFUqgeaVxih61UyLyosbrIF osX13/efR5mW4u5+togW+QWNEeV4vseGCdXW+AZstLYmwCY5eQPjwRIQlZXdJmYmNZ3x AK2vz+UdEnH3Di/k/8YKJxFfb2f74F+wAbvSw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=G5Xp/SetqJHau3ovqQgVO6niEDopFjuau02sXk0g07UCXnbxccFB+f3W6CG3T6ePlS gPzFzEZP6dLq0S63h4yxEQrhrzGbNiTx3m8E7OIpWDqu+Ee/NVsJB8d3eHL/n0MXJcZR 9k6ubuw8r9wElLz8xWtvtYDoXpLwJ9p48VpvI= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id c13mr3283956ybn.127.1241652519140; Wed, 06 May 2009 16:28:39 -0700 (PDT) In-Reply-To: <fhopkins@example.org> References: <fhopkins@example.org> <fhopkins@example.org> <fhopkins@example.org> From: Ted Dunning <fhopkins@example.org> Date: Wed, 6 May 2009 16:28:19 -0700 Message-ID: <fhopkins@example.org> Subject: Re: Help Debugging Periodic Error To: fhopkins@example.org Content-Type: multipart/alternative; boundary=001e680f0f3c567cc1046946c18c X-Virus-Checked: Checked by ClamAV on apache.org --001e680f0f3c567cc1046946c18c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit This sounds like it is the opposite problem. Your connection is probably being closed for you somehow after being idle. Depending on your speed requirements, you can re-open the transport for each burst of activity or you can use a pooling strategy to close idle connections and re-open them when you need to do more work. On Wed, May 6, 2009 at 4:16 PM, Curtis Spencer <fhopkins@example.org> wrote: > Also, one other thing I ought to mention is that I have never seen it > happen when the service is under a heavy load. Usually when a first > request after a lull period or after a deploy. > --001e680f0f3c567cc1046946c18c-- From thrift-user-returnfhopkins@example.org Thu May 07 00:19:23 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 33976 invoked from network); 7 May 2009 00:19:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 May 2009 00:19:23 -0000 Received: (qmail 14442 invoked by uid 500); 7 May 2009 00:19:22 -0000 Delivered-To: fhopkins@example.org Received: (qmail 14413 invoked by uid 500); 7 May 2009 00:19:22 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 14403 invoked by uid 99); 7 May 2009 00:19:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 00:19:22 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-qy0-f124.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 00:19:13 +0000 Received: by qyk30 with SMTP id 30so784722qyk.32 for <fhopkins@example.org>; Wed, 06 May 2009 17:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=NZrN9cqGZrbCdLvyBKZ4X0KY9YLBFwFgyyYtwpnQ54g=; b=lfdhl+LcLt6KXAbxyl91rE5jkYo5oHBXf0c2YE50NOnQrtuTeXFgA/8wpnEId9+8bl MwPQFiYA5ExNv0pJROwylFYQ42TofqV5UNR7weVTEUhe/tbwGVRk28DuLLVs8CrZHSN/ wXnYPlBBLVsvneL5fXF8+z7NNUWyGnPiE1og0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=Msryj7IBoJkSOwrm1uWil1hoqe/WMQu8TtilSXSRQw4x+d+6gUuUMaz3SQ2YQhz8rT Xde7XR/NBOJuWGMkOaorvi/8+sqtim7aNoHczHfs25R+irWnPhZ1z7kvcKWiyJVowSS9 z4wtVUn8Yel3BezEVu8bC3g2yOzRPTJKWsPY4= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id d11mr1796957qcj.51.1241655533122; Wed, 06 May 2009 17:18:53 -0700 (PDT) In-Reply-To: <fhopkins@example.org> References: <fhopkins@example.org> <fhopkins@example.org> <fhopkins@example.org> <fhopkins@example.org> From: Curtis Spencer <fhopkins@example.org> Date: Wed, 6 May 2009 17:18:33 -0700 Message-ID: <fhopkins@example.org> Subject: Re: Help Debugging Periodic Error To: fhopkins@example.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Wed, May 6, 2009 at 4:28 PM, Ted Dunning <fhopkins@example.org> wrote: > This sounds like it is the opposite problem. =A0Your connection is probab= ly > being closed for you somehow after being idle. > > Depending on your speed requirements, you can re-open the transport for e= ach > burst of activity or you can use a pooling strategy to close idle > connections and re-open them when you need to do more work. Ted, I am going through this execution path on every request in my app server: shared_ptr<TSocket> socket(new TSocket(host_name,port))); socket->setConnTimeout(THRIFT_TIMEOUT); // Which Equals 10000 socket->setRecvTimeout(THRIFT_TIMEOUT); shared_ptr<TTransport> transport(new TBufferedTransport(socket)); shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport)); MyClient client(protocol); try { transport->open(); client.mycall(results); transport->close(); } catch (TException &tx) { cerr << "Caught Exception" << endl; } Wouldn't that be opening the transport anew each time? So it shouldn't be keeping any connections open correct? I have found the performance to be fine, without worrying about a connection pooling strategy, although that is a question for another day. -Curtis From thrift-user-returnfhopkins@example.org Thu May 07 00:42:54 2009 Return-Path: <thrift-user-returnfhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 37653 invoked from network); 7 May 2009 00:42:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 May 2009 00:42:54 -0000 Received: (qmail 22652 invoked by uid 500); 7 May 2009 00:42:53 -0000 Delivered-To: fhopkins@example.org Received: (qmail 22599 invoked by uid 500); 7 May 2009 00:42:53 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <thrift-user.incubator.apache.org> Reply-To: fhopkins@example.org Delivered-To: mailing list fhopkins@example.org Received: (qmail 22589 invoked by uid 99); 7 May 2009 00:42:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 00:42:53 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-gx0-f221.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 00:42:45 +0000 Received: by gxk21 with SMTP id 21so497573gxk.12 for <fhopkins@example.org>; Wed, 06 May 2009 17:42:24 -0700 (PDT) DKIM-Signature: v=1;
{'source': 'Apache Software Foundation Public Mail Archives'}