You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Sean Beck <se...@gmail.com> on 2013/05/28 18:45:51 UTC

Connection to message broker hanging

So I am using a consumer/producer with an apache module of mine and I have
a script to test that the module is working properly. I started the message
broker as root. I run my script as root. It seems to get stuck waiting for
a response from the server.

When I run httpd in gdb and step through the whole process it properly
creates and sends my message, but when httpd is running on its own the
script just hangs. When httpd is running it does everything as the apache
user rather than root which is what I start it with.

What do you think the problem is? My thought is something to do with file
permissions, but I don't see why that would affect simply sending a message
to the broker from my module.

Thanks

Re: Connection to message broker hanging

Posted by Sean Beck <se...@gmail.com>.
I ran "setenforce 0" and all the problems disappeared. Why would disabling
SE Linux fix this?


On Thu, May 30, 2013 at 8:00 AM, Sean Beck <se...@gmail.com> wrote:

> I am using fusemq, the C wrapper for ActiveMQ-CPP.
>
> The problem is I am using the broker with an Apache server module. It is
> supposed to send a message to the broker so another program can consume it.
> I have a script that tests all of this and I have logging in my module that
> tells me if the message was sent successfully. When Apache is started
> normally as root and ActiveMQ is started as root, my script gets stuck. The
> traceback says that it was still waiting for a response. I noticed in my
> logs that the module gets stuck at creating a default session with the
> broker. When I step through the module in GDB under these same
> circumstances the message is sent successfully and the admin panel says
> there is a message in my queue. When the module runs it does everything as
> the apache user so I thought that was the problem. So I start the server
> normally and run ActiveMQ as apache. When I do that my logs tell me the
> message is sent successfully, the script completes, but I am unable to
> access the admin panel.
>
> Here is the output in the activemq.log when I get the 503:
>
> 2013-05-28 13:47:51,823 | WARN  | Committed before 503 null | org.eclipse.jetty.server.Response | qtp1146944158-23
> 2013-05-28 13:47:51,824 | WARN  | /admin/ | org.eclipse.jetty.server.AbstractHttpConnection | qtp1146944158-23
> java.lang.IllegalStateException: Committed
>      at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1126)
>      at org.eclipse.jetty.server.Response.sendError(Response.java:313)
>      at org.eclipse.jetty.server.Response.sendError(Response.java:415)
>      at org.eclipse.jetty.server.handler.ContextHandler.checkContext(ContextHandler.java:820)
>      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:916)
>      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
>      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
>      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
>      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
>      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
>      at org.eclipse.jetty.server.Server.handle(Server.java:363)
>      at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)
>      at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)
>      at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)
>      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
>      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
>      at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
>      at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627)
>      at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51)
>      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
>      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
>      at java.lang.Thread.run(Thread.java:722)
>
>
>
>
> On Wed, May 29, 2013 at 3:46 PM, Christian Posta <
> christian.posta@gmail.com> wrote:
>
>> What protocol are you using to connect to the broker? STOMP?
>> Can you see what frames have gone to the broker? Can you take a thread
>> dump
>> of the broker and post here?
>>
>>
>> On Tue, May 28, 2013 at 9:45 AM, Sean Beck <se...@gmail.com>
>> wrote:
>>
>> > So I am using a consumer/producer with an apache module of mine and I
>> have
>> > a script to test that the module is working properly. I started the
>> message
>> > broker as root. I run my script as root. It seems to get stuck waiting
>> for
>> > a response from the server.
>> >
>> > When I run httpd in gdb and step through the whole process it properly
>> > creates and sends my message, but when httpd is running on its own the
>> > script just hangs. When httpd is running it does everything as the
>> apache
>> > user rather than root which is what I start it with.
>> >
>> > What do you think the problem is? My thought is something to do with
>> file
>> > permissions, but I don't see why that would affect simply sending a
>> message
>> > to the broker from my module.
>> >
>> > Thanks
>> >
>>
>>
>>
>> --
>> *Christian Posta*
>> http://www.christianposta.com/blog
>> twitter: @christianposta
>>
>
>

Re: Connection to message broker hanging

Posted by Sean Beck <se...@gmail.com>.
I am using fusemq, the C wrapper for ActiveMQ-CPP.

The problem is I am using the broker with an Apache server module. It is
supposed to send a message to the broker so another program can consume it.
I have a script that tests all of this and I have logging in my module that
tells me if the message was sent successfully. When Apache is started
normally as root and ActiveMQ is started as root, my script gets stuck. The
traceback says that it was still waiting for a response. I noticed in my
logs that the module gets stuck at creating a default session with the
broker. When I step through the module in GDB under these same
circumstances the message is sent successfully and the admin panel says
there is a message in my queue. When the module runs it does everything as
the apache user so I thought that was the problem. So I start the server
normally and run ActiveMQ as apache. When I do that my logs tell me the
message is sent successfully, the script completes, but I am unable to
access the admin panel.

Here is the output in the activemq.log when I get the 503:

2013-05-28 13:47:51,823 | WARN  | Committed before 503 null |
org.eclipse.jetty.server.Response | qtp1146944158-23
2013-05-28 13:47:51,824 | WARN  | /admin/ |
org.eclipse.jetty.server.AbstractHttpConnection | qtp1146944158-23
java.lang.IllegalStateException: Committed
     at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1126)
     at org.eclipse.jetty.server.Response.sendError(Response.java:313)
     at org.eclipse.jetty.server.Response.sendError(Response.java:415)
     at org.eclipse.jetty.server.handler.ContextHandler.checkContext(ContextHandler.java:820)
     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:916)
     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
     at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
     at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
     at org.eclipse.jetty.server.Server.handle(Server.java:363)
     at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)
     at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)
     at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)
     at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
     at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
     at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
     at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627)
     at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51)
     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
     at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
     at java.lang.Thread.run(Thread.java:722)




On Wed, May 29, 2013 at 3:46 PM, Christian Posta
<ch...@gmail.com>wrote:

> What protocol are you using to connect to the broker? STOMP?
> Can you see what frames have gone to the broker? Can you take a thread dump
> of the broker and post here?
>
>
> On Tue, May 28, 2013 at 9:45 AM, Sean Beck <se...@gmail.com>
> wrote:
>
> > So I am using a consumer/producer with an apache module of mine and I
> have
> > a script to test that the module is working properly. I started the
> message
> > broker as root. I run my script as root. It seems to get stuck waiting
> for
> > a response from the server.
> >
> > When I run httpd in gdb and step through the whole process it properly
> > creates and sends my message, but when httpd is running on its own the
> > script just hangs. When httpd is running it does everything as the apache
> > user rather than root which is what I start it with.
> >
> > What do you think the problem is? My thought is something to do with file
> > permissions, but I don't see why that would affect simply sending a
> message
> > to the broker from my module.
> >
> > Thanks
> >
>
>
>
> --
> *Christian Posta*
> http://www.christianposta.com/blog
> twitter: @christianposta
>

Re: Connection to message broker hanging

Posted by Christian Posta <ch...@gmail.com>.
What protocol are you using to connect to the broker? STOMP?
Can you see what frames have gone to the broker? Can you take a thread dump
of the broker and post here?


On Tue, May 28, 2013 at 9:45 AM, Sean Beck <se...@gmail.com> wrote:

> So I am using a consumer/producer with an apache module of mine and I have
> a script to test that the module is working properly. I started the message
> broker as root. I run my script as root. It seems to get stuck waiting for
> a response from the server.
>
> When I run httpd in gdb and step through the whole process it properly
> creates and sends my message, but when httpd is running on its own the
> script just hangs. When httpd is running it does everything as the apache
> user rather than root which is what I start it with.
>
> What do you think the problem is? My thought is something to do with file
> permissions, but I don't see why that would affect simply sending a message
> to the broker from my module.
>
> Thanks
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta