Re: Treads on timed_waiting with lockPage

2013-02-06 Thread Martin Grigorov
Hi,

Wicket serializes the access to a page instance. Only one thread at a time
can use a page instance/version.
PageAccessSynchronizer implementation is since 1.5.0 and so far there were
no reports for such problem.

Here is how this situation may happen (partially):
Wicket Ajax APIs (JavaScript) uses
http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxChannel.html.
All Ajax requests which use the same Ajax channel name are serialized
at
the client side, i.e. they are executed one by one. You can use Ajax
behaviors with different ajax channels and this way they wont be
synchronized at the client side, so several requests will be made to the
same page instance. This will reproduce your problem _partially_ because
the browsers have limit of maximum requests to the same domain: IE - 2,
Chrome and FF - 8. So you can have at most 8 http worker threads waiting to
get access to the same page instance. But I guess your thread pool has more
than 8 threads.


On Wed, Feb 6, 2013 at 3:46 PM, Ann Baert  wrote:

> We have a wicket application in production, and from time to time a strange
> phenomenon happens.
> We're using jetty, and at a certain moment, the whole pool of jetty worker
> treads is filled up.
> I've made a program that dumps the stack traces of all active treads, and a
> lot of treads are
> blocking on the same piece of code. Could there be some threading issue in
> the wicket code?
> Below you find the stack trace where most of the treads are blocking on.
>
> 1131 qtp2146332552-1131 TIMED_WAITING:
>   at java.lang.Object.wait(Native Method)
>   at
>
> org.apache.wicket.page.PageAccessSynchronizer.lockPage(PageAccessSynchronizer.java:126)
>   at
>
> org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:256)
>   at
>
> org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117)
>   at
>
> org.apache.wicket.request.handler.PageProvider.getStoredPage(PageProvider.java:302)
>   at
>
> org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:257)
>   at
>
> org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
>   at
>
> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.getPage(ListenerInterfaceRequestHandler.java:100)
>   at
>
> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:165)
>   at
>
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
>   at
>
> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
>   at
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
>   at
>
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
>   at
>
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
>   at
>
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
>   at
>
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
>   at
>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
>   at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
>   at
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
>   at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
>   at
>
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
>   at
>
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
>   at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
>   at
>
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
>   at
>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
>   at
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
>   at
>
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
>   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:365)
>   at
>
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
>   at
>
> org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:937)
>   at
>
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:998)
>   at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
>   at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
>   at
>
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
>   at
>
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectC

Treads on timed_waiting with lockPage

2013-02-06 Thread Ann Baert
We have a wicket application in production, and from time to time a strange
phenomenon happens.
We're using jetty, and at a certain moment, the whole pool of jetty worker
treads is filled up.
I've made a program that dumps the stack traces of all active treads, and a
lot of treads are
blocking on the same piece of code. Could there be some threading issue in
the wicket code?
Below you find the stack trace where most of the treads are blocking on.

1131 qtp2146332552-1131 TIMED_WAITING:
  at java.lang.Object.wait(Native Method)
  at
org.apache.wicket.page.PageAccessSynchronizer.lockPage(PageAccessSynchronizer.java:126)
  at
org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:256)
  at
org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117)
  at
org.apache.wicket.request.handler.PageProvider.getStoredPage(PageProvider.java:302)
  at
org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:257)
  at
org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
  at
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.getPage(ListenerInterfaceRequestHandler.java:100)
  at
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:165)
  at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
  at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
  at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
  at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
  at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
  at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
  at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
  at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
  at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
  at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
  at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
  at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
  at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
  at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
  at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
  at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
  at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
  at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
  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:365)
  at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
  at
org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:937)
  at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:998)
  at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
  at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
  at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
  at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
  at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
  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)




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Treads-on-timed-waiting-with-lockPage-tp4656126.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org