qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nithesh Shetty <knitheshshe...@yahoo.com>
Subject Re: exchangeDeclare funtion hangs
Date Fri, 25 Sep 2009 05:25:51 GMT
Apologies for the earlier mail.
 
Atlast i have zeroed on what causes exchangeDeclare funtion to Hang
 
here is a sample example
 
#include <qpid/client/Connection.h>
#include <qpid/cleint/Session.h>
#include <qpid/client/Message.h>
 
using namespace qpid::client;
using namespace qpid::framing;
 
int main(int argc, char **argv)
{
    const char* host = argc>1 ? argv[1] : "127.0.0.1";
    int port = argc>2 ? atoi(argv[2]) : 5672
    Connection connection;
 
    try
    {
         connection.open(host, port);
         Session session = connection.newSession();
 
         Message message; //**************  it works if i comment this ******************/
          session.exchangeDeclare(arg::exchange = "ALTER_EXCH_QM", arg::exclusive
= false, arg::autoDelete = false, arg::type = "direct");
          session.queueDeclare(arg::queue = "RMS", arg::exclusive = false, arg::autoDelete
= false, arg::arguments = lcQueueOptions);  
          session.exchangeBind(arg::exchange = "ALTER_EXCH_QM", arg::queue = "RMS",
arg::bindingKey = "QM_ROUTE_KEY");
    
        connection.close();
        return 0;
      } catch(const std::exception& error)
      {
               std::cout << error.what() << std::endl;
      }
      return 1;
 
 
    }
 
If i comment /***** Message message; ***/ in the above code it works fine
if i uncomment it then the program hangs at  exchangeDeclare. it hangs even at queueDeclare

if i comment exchangeDeclare
 
Awaiting your reply to proceed.
 
Regards,
 
Nithesh
 
}
 


--- On Thu, 9/24/09, Nithesh Shetty <knitheshshetty@yahoo.com> wrote:


From: Nithesh Shetty <knitheshshetty@yahoo.com>
Subject: Re: exchangeDeclare funtion hangs
To: users@qpid.apache.org
Date: Thursday, September 24, 2009, 3:38 PM


in Future.cpp
 
void Future::wait(SessionImpl& session)
{
    if (!complete)
  {     
}
}

--- On Thu, 9/24/09, Nithesh Shetty <knitheshshetty@yahoo.com> wrote:


From: Nithesh Shetty <knitheshshetty@yahoo.com>
Subject: Re: exchangeDeclare funtion hangs
To: users@qpid.apache.org
Date: Thursday, September 24, 2009, 5:26 AM



qpidclient test exe built using the below option 
  
g++ -pipe -march=pentium4 -mtune=pentium4 -Wconversion -Wpadded -Wall -Wextra -Wno-shadow
-Wpointer -arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolative-register-var -Winvalid-pch
-Wno_system-headers -Woverloaded-virutal -DNDEBUG -g -L/usr/lib/openais -L/usr/lib/corosync
 /root/qpid0.5/qpidc-0.5/src/.libs/libqpidclient.so /root/qpid0.5/qpidc-0.5/src/.libs/libqpidcommon.so

messagequeue.cc qpidtest.cpp -o qpidtest -ld -lrt  
  
pstack for client exe qpidtest. 
  
Thread 2 (Thread -1208087664 (LWP 15654)): 
#0 0x00893402 in __kernel_vsyscall() 
#1 0x006767c6 in __epoll_wait_nocancel () from /lib/libc.so.6 
#2 0x004c7dc3 in qpid::sys::Poller::wait () 
#3 0x005133e5 in qpid::sys::Dispatcher::run() 
#4 0x00d20f93 in qpid::client::TCPConnector::run() 
#5 0x004be891 in qpid::sys::(anonymous namespace)::runRunnable () 
#6 0x0027a2db in start_thread () from /lib/libpthread.so.0 
#7 0x0067614e in clone() from /lib/libc.so.6 
Thread 1 (Thread -1208084768 (LWP 15653)): 
#0 0x00893402 in __kernel_vsyscall () 
#1 0x0027e146 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libthread.so.0 
#2 0x006827ad in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libc.so.6 
#3 0x00d53ell in qpid::client::SessionImpl::waitForCompletionImpl() 
#4 0x0053ed7 in qpid::client::SessionImpl::waitForCompletion() 
#5 0x00d3fbaf in qpid::client::Future::wait() 
#6 0x00cfb2af in qpid::client::no_keyword::Session_0_10::exchangeDeclare() 
#7 0x0805e0ea in qpid::client::Session_0_10::exchangeDeclare_with_named_params<boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<qpid::client::arg::keyword_tags::exchange,
char const [14]>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<qpid::client::arg::keyword_tags::exclusive,
bool const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<qpid::client::arg::keyword_tags::autoDelete,
bool const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<qpid::client::arg::keyword_tags::type,
char const[7]>, boost::parameter::aux::empty_arg_list> > > > > () 
#8 0x0805e251 in qpid::client::Session_0_10::exchangeDeclare<boost::parameter::aux::tagged_argument<qpid::client::arg::keyword_tags::exchange,
char const [14]> boost::parameter::aux::tagged_argument<qpid::client::arg::keyword_tags::exclusive,
bool const>, boost::parameter::aux::tagged_argument<qpid::client::arg::keyword_tags::autoDelete,
bool const>. boost::parameter::aux::tagged_argument<qpid::client::arg::keyword_tags::type,
char const [7]> > () 
#9 0x0805b6ae in main() 
#0 0x00893402 in __kernel_vsyscall()
 
 
 
broker started with following option
/.qpidd --auth no -p 5004
 
pstack for broker
 
Thread 6 (Thread -1208837232 (LWP 7962)):
#0 0x00c96402 in __kernel_vsyscall ()
#1 0x004c83cc in pthread_cond_timedwait@@GLIBC_2.3.2 ()
#2 0x0042a7f4 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3 0x00f2ef50 in qpid::broker::Timer::run()
#4 0x009bc581 in qpid::sys:(anonymous namespace)::runRunnable()
#5 0x004c42db in start_thread () from /lib/libpthread.so.0
#6 0x0041e14e in clone() from /lib/libc.so.6
Thread 5 (Thread -1219327088 (LWP 7963)):
#0 0x00c96402 in __kernel_vsyscall ()
#1 0x004c83cc in pthread_cond_timedwait@@GLIBC_2.3.2 ()
#2 0x0042a7f4 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3 0x00f2ef50 in qpid::broker::Timer::run()
#4 0x009bc581 in qpid::sys:(anonymous namespace)::runRunnable()
#5 0x004c42db in start_thread () from /lib/libpthread.so.0
#6 0x0041e14e in clone() from /lib/libc.so.6
Thread 4 (Thread -1229816944 (LWP 7964)):
#0 0x00c96402 in __kernel_vsyscall ()
#1 0x004c83cc in pthread_cond_timedwait@@GLIBC_2.3.2 ()
#2 0x0042a7f4 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libc.so.6
#3 0x00f2ef50 in qpid::broker::Timer::run()
#4 0x009bc581 in qpid::sys:(anonymous namespace)::runRunnable()
#5 0x004c42db in start_thread () from /lib/libpthread.so.0
#6 0x0041e14e in clone() from /lib/libc.so.6
Thread 3 (Thread -1240306800 (LWP 7965))
#0 0x00c96402 in __kernel_vsyscall ()
#1 0x0041e7c6 in __epoll_wait_nocancel() from /lib/lib.so.6
#2 0x009c46a4 in qpid::sys::Poller::wait()
#3 0x009c55d3 in qpid::sys::Poller::run()
#4 0x00a18744 in qpid::sys::Dispatcher::run()
#5 0x009bc581 in qpid::sys::(anonymous namespace)::runRunnable
#6 0x004c42db in start_thread () from /lib/libpthread.so.0
#7 0x0041e14e in clone() from /lib/libc.so.6
Thread 2 (Thread -1250796656 (LWP 7966))
#0 0x00c96402 in __kernel_vsyscall ()
#1 0x0041e7c6 in __epoll_wait_nocancel() from /lib/lib.so.6
#2 0x009c46a4 in qpid::sys::Poller::wait()
#3 0x009c55d3 in qpid::sys::Poller::run()
#4 0x00a18744 in qpid::sys::Dispatcher::run()
#5 0x009bc581 in qpid::sys::(anonymous namespace)::runRunnable
#6 0x004c42db in start_thread () from /lib/libpthread.so.0
#7 0x0041e14e in clone() from /lib/libc.so.6
Thread 1 (Thread -1208628352 (LWP 7948))
#0 0x00c96402 in __kernel_vsyscall ()
#1 0x0041e7c6 in __epoll_wait_nocancel() from /lib/lib.so.6
#2 0x009c46a4 in qpid::sys::Poller::wait()
#3 0x009c55d3 in qpid::sys::Poller::run()
#4 0x00a18744 in qpid::sys::Dispatcher::run()
#5 0x00e65071 in qpid::broker::Broker::run()
#6 0x0804e9a4 in QpiddBroker::execute()
#7 0x0804c8d7 in main()
#0 0x00c96402 in __kernel_vsyscall()
 
Awaiting your reply.
 
Regards,
Nithesh

--- On Wed, 9/23/09, Gordon Sim <gsim@redhat.com> wrote:


From: Gordon Sim <gsim@redhat.com>
Subject: Re: exchangeDeclare funtion hangs
To: users@qpid.apache.org
Date: Wednesday, September 23, 2009, 7:38 PM


On 09/23/2009 01:48 PM, Nithesh Shetty wrote:
> Hi,
>
> Version is qpid0.5

Can you run pstack against both the client and qpidd processes at the 
point of the hang?

>
> I have created a class called CMessageQueue
> it has two Function called OpenConnection  and OpenQueue
>
> member variables are
> Session m_cSession
> Connection m_cConnection.
>
> int CMessageQueue:: OpenConnection(const string szHost,
>                                                         
                const short int nPort,
>                                                         
                  const string szUserName,
>                                                         
                 const string szPassword)
>
> {
> Connection Settings lcConnSettings;
> lcConnSettings.host = szHost;
> lcConnSettings.port = nPort;
> lcConnSettings.maxFramesize = 2046;
> lcConnSettings.virtualhost = "/";
> lcConnSettings.username = szUserName; //guest
> lcConnSettings.password = szPassword; //guest
>
> if (!m_cConnection.isOpen)
> {
>    m_cConnection.open(lcConnSettings);
>    m_cSession = m_cConnection.newSession();
> }
> }
>
> int CMessageQueue::openQueue(const QueueOrderingPolicy cQOP)
> {
>     QueueOptions lcQueueOptions;
>     lcQueueOptions.setOrdering(cQOP);
>
>   m_cSession.exchangeDeclare(arg::exchange = "alter_exch", arg::exclusive = false,
arg::autoDelete = false, arg::type = "direct"); //hangs here
> m_cSession.queueDeclare(arg::queue = "alter_queue", arg::exclusice =false, arg::autoDelete
= false, arg::arguments = lcQueueOptions);
> m_cSession.exchangeBind(arg::exchange = "alter_exch", arg::queue = "alter_queue", arg::bindingKey
= "key");
>
>   m_cSession.exchangeDeclare(arg::exchange = "exch", arg::exclusive = false, arg::autoDelete
= false, arg::type = "direct");
> m_cSession.queueDeclare(arg::queue = "queue", arg::exclusice =false, arg::autoDelete
= false, arg::arguments = lcQueueOptions, arg::alternateExchange = "alter_exch");
> m_cSession.exchangeBind(arg::exchange = "exch", arg::queue = "queue", arg::bindingKey
= "key");
>
>
> }
>
> Now after calling OpenConnection
> i call OpenQueue then its hangs at exchangeDeclare
>
> Regards,
> NIthesh
>
> --- On Wed, 9/23/09, Steve Huston<shuston@riverace.com>  wrote:
>
>
> From: Steve Huston<shuston@riverace.com>
> Subject: RE: exchangeDeclare funtion hangs
> To: users@qpid.apache.org
> Date: Wednesday, September 23, 2009, 12:20 PM
>
>
> Hi Nitesh,
>
> What version of Qpid do you see this problem in? Could you post a
> small test program that reproduces this?
>
> Thanks,
> -Steve
>
> --
> Steve Huston, Riverace Corporation
>
>> -----Original Message-----
>> From: Nithesh Shetty [mailto:knitheshshetty@yahoo.com]
>> Sent: Wednesday, September 23, 2009 8:01 AM
>> To: users@qpid.apache.org
>> Subject: exchangeDeclare funtion hangs
>>
>>
>> Hi,
>>
>> When I try to declare exchange using
>> Session.exchangeDeclare(arg::exchange = "NAME",
>> arg::exclusive = false, arg::autoDelete = false, arg::type =
>> "direct");
>>
>>
>> it hangs in
>> VOID Condition::wait(Mutex&  mutex)
>> {
>>      QPID_POSIX_ASSERT_THROW_IF(pthread_cond_destroy(&condition));
>> }
>>
>> Need help to proceed.
>>
>> Regards,
>> Nithesh
>>
>>
>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>
>
>
>


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




      


      


      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message