qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shan Wang" <Shan.W...@igindex.co.uk>
Subject RE: c++ client throw exception when trying to
Date Wed, 06 May 2009 18:40:37 GMT
Calling connection.close() worked, thanks a lot!

But I can't call SubscriptionManager::cancel() while the connection is
blocking on execute(), otherwise I got the same FATAL exception as
before.



-----Original Message-----
From: Andrew Stitcher [mailto:astitcher@redhat.com] 
Sent: 06 May 2009 19:28
To: dev@qpid.apache.org
Subject: Re: c++ client throw exception when trying to

As far as I know the qpid client code is not designed to cope with
pthread_cancel() shutting down threads in which it is running, and it
could do bad things.

I think the thing to do is to close() the  relevant connection. That
should cause any call blocked on that connection to exit or throw an
exception. Then you can leave the thread loop or cancel the thread if
necessary.

Andrew

On Wed, 2009-05-06 at 18:59 +0100, Shan Wang wrote:
> A FailoverManager runs in a separate thread, because that execute()
> function is a blocking call, I tried to use pthread_cancel() in main
> thread to kill the FailoverManager thread, but it got the following
> error:
> 
>  
> 
> 2009-may-06 18:02:50 warning Session was not closed cleanly
> 
> FATAL: exception not rethrown
> 
> Aborted
> 
>  
> 
> I thought it had something to do with pthread_cancel, so I commented
out
> all the qpid related code, then the error disappeared. If I comment
out
> the SubscriptionManager::cancel() and FailoverManager::close()
function,
> the error still exists, but only happens occasionally rather than
every
> time. I wonder have anyone seen this kind of problem before, what is
the
> correct way to close a connection, do I have to call cancel() and
> close()?
> 
>  
> 
> 
> 
> Thanks & Regards,
> 
> Shan
> 
>  
> 
> The information contained in this email is strictly confidential and
for the use of the addressee only, unless otherwise indicated. If you
are not the intended recipient, please do not read, copy, use or
disclose to others this message or any attachment. Please also notify
the sender by replying to this email or by telephone (+44 (0)20 7896
0011) and then delete the email and any copies of it. Opinions,
conclusions (etc.) that do not relate to the official business of this
company shall be understood as neither given nor endorsed by it. IG
Index plc is a company registered in England and Wales under number
01190902. VAT registration number 761 2978 07. Registered Office: Friars
House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised and
regulated by the Financial Services Authority. FSA Register number
114059.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org

The information contained in this email is strictly confidential and for the use of the addressee
only, unless otherwise indicated. If you are not the intended recipient, please do not read,
copy, use or disclose to others this message or any attachment. Please also notify the sender
by replying to this email or by telephone (+44 (0)20 7896 0011) and then delete the email
and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business
of this company shall be understood as neither given nor endorsed by it. IG Index plc is a
company registered in England and Wales under number 01190902. VAT registration number 761
2978 07. Registered Office: Friars House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised
and regulated by the Financial Services Authority. FSA Register number 114059.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Mime
View raw message