Return-Path: X-Original-To: apmail-thrift-user-archive@www.apache.org Delivered-To: apmail-thrift-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 444D5955 for ; Mon, 18 Jun 2012 22:22:28 +0000 (UTC) Received: (qmail 98530 invoked by uid 500); 18 Jun 2012 22:22:27 -0000 Delivered-To: apmail-thrift-user-archive@thrift.apache.org Received: (qmail 98502 invoked by uid 500); 18 Jun 2012 22:22:27 -0000 Mailing-List: contact user-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@thrift.apache.org Delivered-To: mailing list user@thrift.apache.org Received: (qmail 98493 invoked by uid 99); 18 Jun 2012 22:22:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2012 22:22:27 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=FSL_RCVD_USER,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mchambers@wetafx.co.nz designates 110.232.144.26 as permitted sender) Received: from [110.232.144.26] (HELO meera.wetafx.co.nz) (110.232.144.26) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2012 22:22:21 +0000 Received: from localhost (localhost [127.0.0.1]) by meera.wetafx.co.nz (Postfix) with ESMTP id 2D23E9F00014 for ; Tue, 19 Jun 2012 10:21:58 +1200 (NZST) X-Virus-Scanned: with amavisd-new by meera at meera.wetafx.co.nz Received: from meera.wetafx.co.nz ([127.0.0.1]) by localhost (meera.wetafx.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qym8ouR8WF7F; Tue, 19 Jun 2012 10:21:28 +1200 (NZST) Received: from jupiter036.localdomain (webmail.wetafx.co.nz [192.168.120.66]) by meera.wetafx.co.nz (Postfix) with ESMTP id 48CBD9F00024 for ; Tue, 19 Jun 2012 10:21:20 +1200 (NZST) Received: from localhost (localhost [127.0.0.1]) by jupiter036.localdomain (Postfix) with ESMTP id 38BB45BEB70 for ; Tue, 19 Jun 2012 10:21:20 +1200 (NZST) X-Virus-Scanned: amavisd-new at wetafx.co.nz Received: from jupiter036.localdomain ([127.0.0.1]) by localhost (smtp-digi.wetafx.co.nz [127.0.0.1]) (amavisd-new, port 10024) with LMTP id oEpakCgzrGOz for ; Tue, 19 Jun 2012 10:21:20 +1200 (NZST) Received: from [192.168.49.192] (spearfish.wetafx.co.nz [192.168.49.192]) by jupiter036.localdomain (Postfix) with ESMTP id 1B7B95BE996 for ; Tue, 19 Jun 2012 10:21:20 +1200 (NZST) Message-ID: <4FDFA9E0.5000407@wetafx.co.nz> Date: Tue, 19 Jun 2012 10:21:20 +1200 From: Matthew Chambers User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120601 Thunderbird/10.0.5 MIME-Version: 1.0 To: user@thrift.apache.org Subject: Re: Thrift C++ question References: <4FDFA3EC.5000006@wetafx.co.nz> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Actually, your right, I can. My hassle is that its quite a bit of code duplication (we have a large API) but I can just make a macro. Thanks, Matt On 19/06/12 10:14, Mark Slee wrote: > Are you asking about a C++ client? Why can't you apply the same technique as you're doing with Python? > > If you get a TTransportException, the right thing to do is to close and discard the transport as it may no longer be in a reliable state, then try again if so desired (ideally with some logic to prevent infinite retry loops in a non-intermittent failure scenario). > > Another way of asking, what is the hassle you're encountering that seems specific to C++? > ________________________________________ > From: Matthew Chambers [mchambers@wetafx.co.nz] > Sent: Monday, June 18, 2012 2:55 PM > To: user@thrift.apache.org > Subject: Thrift C++ question > > Anyone have a good way to retry an RPC on another connection if the > client side service object fails with a TTransportException or socket > error? > > In python its easy, I just bring up a new TSocket, Protocol, Transport, > and Service on a different node and call the same function with the same > args. Users never even know a server just died or was restarted. With > C++ its proving to be more of a hassle. > > -Matt