thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Benner <LBen...@tomtec.de>
Subject RE: C++ TThreadPoolServer shutdown
Date Tue, 25 Mar 2014 18:02:40 GMT
Hi,

I rebuild the Thrift lib today, just to make sure my lib wasn't corrupted.

During the rebuild I got a warning, that no public symbols are available for TTransportException.
For removing this warning I moved the implementation of TTransportException::what() from the
header file to the cpp file. After doing this and rebuilding the complete application the
problem was gone.

I not quite sure if I have enough insight in the compiler and linker stuff. But I assume that
somehow the code generated for TTransportException for the lib and in my application did not
match. Which would also explain the lack off a call stack. And by moving at least one method
into the cpp file and thus into the lib, the lib code was used for building the actual application.

Anyway, I prefer implementations of virtual functions in the cpp files. So what is the best
way for getting my changes into the next version?

Thanks again for all your comments and help,
- Lars

-----Original Message-----
From: Nevo Hed [mailto:nhed+thriftusr@aereo.com] 
Sent: Tuesday, March 25, 2014 4:51 PM
To: Thrift Users
Subject: Re: C++ TThreadPoolServer shutdown

ignore me, I didn't even pay attention to which threads are being joined etc


On Tue, Mar 25, 2014 at 11:48 AM, Nevo Hed <nhed+thriftusr@aereo.com> wrote:

> Never used this class nor look at trace but I think join is called 
> already from serve (so you should not call it again)
>
>
>   // If stopped manually, join the existing threads
>
>
>   if (stop_) {
>     try {
>       serverTransport_->close();
>       threadManager_->join();
>     } catch (TException &tx) {
>       string errStr = string("TThreadPoolServer: Exception shutting down:
> ") + tx.what();
>       GlobalOutput(errStr.c_str());
>
>
>
>
>
>
> On Mon, Mar 24, 2014 at 4:38 PM, Lars Benner <LBenner@tomtec.de> wrote:
>
>> Hi,
>>
>> I am having a problem, while shutting down a multithreaded thrift 
>> session. Basically I am setting up a TThreadPoolServer with a TPipeServer.
>> Therefore, I call in a separate thread, the serve function of
>> TThreadPoolServer:
>>
>> void run()
>> {
>>   ...
>>
>>   d->pServer->serve();
>> }
>>
>> For shutting down the server, this is done:
>>
>> void shutdown()
>> {
>>   d->pServer->stop();
>>
>>   d->serverThread.join();
>> }
>>
>> If I debug the shutdown function, stepping in or over the stop call 
>> works without a problem. But while waiting for the thread to 
>> terminate I get an unhandled exception:
>>
>> "Unhandled exception at ...: Access violation reading location 
>> 0xffffffff."
>>
>> I figured out that exceptions are used for closing the connection. It 
>> actually looks like, that the Visual Studio debugger is able to catch 
>> the exception as intended, but if I tried to do the next step, I see 
>> the exception above.
>>
>> Has anybody observed a similar issue or has an idea what is going wrong?
>>
>> Please let me additionally note that everything else is working 
>> great, including several thousand calls from the client to the server.
>>
>> You might want also some additional information:
>>
>> Thrift version: 0.9.1
>> Visual Studio 2008
>> Boost version: 1.54.0
>>
>> Thanks,
>> - Lars
>>
>>
>> LARS BENNER / SENIOR SOFTWARE ENGINEER
>> phone: +49 (0)89 32175 593 / e-mail: lbenner@tomtec.de / www.tomtec.de.....................................................................................
>> TOMTEC IMAGING SYSTEMS GMBH
>> Edisonstr. 6 / 85716 Unterschleissheim / Germany
>> fax: +49(0)89 32175 750 | phone: +49(0)89 32175 500 HRB 91397 
>> Amtsgericht Muenchen / Geschäftsführer: Ulrich R. Haupt, Johannes 
>> Waldinger 
>> .....................................................................................
>>
>> Wichtiger Hinweis: Diese E-Mail und etwaige Anlagen können Betriebs- 
>> oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten.
>> Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen der 
>> Status dieser E-Mail bekannt. Bitte benachrichtigen Sie uns in diesem 
>> Fall sofort durch Antwort-Mail und löschen Sie diese E-Mail nebst 
>> etwaigen Anlagen von Ihrem System. Ebenso dürfen Sie diese E-Mail 
>> oder ihre Anlagen nicht kopieren oder an Dritte weitergeben. Vielen Dank!
>>
>> Important Note: This e-mail and any attachment are confidential and 
>> may contain trade secrets or otherwise protected from disclosure. If 
>> you have received it in error, you are on notice of its status. 
>> Please notify us immediately by reply e-mail and then delete this 
>> e-mail and any attachment from your system. If you are not the 
>> intended recipient please understand that you must not copy this 
>> e-mail or any attachment or disclose the contents to any other person. Thanks.
>>
>>
>>
>

Mime
View raw message