Re: pageMap locking issue

2011-12-14 Thread Igor Vaynberg
this has been discussed many times on the list, search the archives...

-igor

On Wed, Dec 14, 2011 at 9:20 AM, Karen Schaper  wrote:
> Hi,
>
> A user was testing a web application.
>
> Apparently they clicked on a link that opened a report and quickly
> clicked the link again.
>
> The web application became unusable and tomcat had to be restarted.
>
> If the issue was a long request time ( perhaps something was going on
> with the database at the time this happened resulting in a hang up ).
>
> What can I do to prevent the entire application being unusable for all
> users?
>
> Here is the message that was in the logs.  This happened on a server
> that I don't have access to right now.  Here is the message I was given.
> I have been unable to reproduce the error myself.
>
>
> org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap
> null is still locked by: Thread[http-bio-8080-exec-2,5,main], giving up
> trying to get the page for path: 309:filterForm
>
> org.apache.wicket.protocol.http.request.InvalidUrlException:
> org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap
> null is still locked by: Thread[http-bio-8080-exec-2,5,main], giving up
> trying to get the page for path: 309:filterForm
>
>        at
> org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
>
>        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
>
>        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>
>        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>
>        at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
>
>        at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>
>        at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
>
>        at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
>
>        at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>
>        at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
>
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
>
>        at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
>
>        at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>
>        at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
>
>        at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:269)
>
>        at org.apache.coyote.AbstractProtocol
> $AbstractConnectionHandler.process(AbstractProtocol.java:515)
>
>        at org.apache.tomcat.util.net.JIoEndpoint
> $SocketProcessor.run(JIoEndpoint.java:300)
>
>        at java.util.concurrent.ThreadPoolExecutor
> $Worker.runTask(ThreadPoolExecutor.java:886)
>
>        at java.util.concurrent.ThreadPoolExecutor
> $Worker.run(ThreadPoolExecutor.java:908)
>
>        at java.lang.Thread.run(Thread.java:662)
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



pageMap locking issue

2011-12-14 Thread Karen Schaper
Hi,

A user was testing a web application.

Apparently they clicked on a link that opened a report and quickly
clicked the link again.

The web application became unusable and tomcat had to be restarted. 

If the issue was a long request time ( perhaps something was going on
with the database at the time this happened resulting in a hang up ). 

What can I do to prevent the entire application being unusable for all
users?

Here is the message that was in the logs.  This happened on a server
that I don't have access to right now.  Here is the message I was given.
I have been unable to reproduce the error myself.


org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap
null is still locked by: Thread[http-bio-8080-exec-2,5,main], giving up
trying to get the page for path: 309:filterForm

org.apache.wicket.protocol.http.request.InvalidUrlException:
org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap
null is still locked by: Thread[http-bio-8080-exec-2,5,main], giving up
trying to get the page for path: 309:filterForm

at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)

at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)

at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)

at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)

at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)

at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)

at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)

at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)

at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)

at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)

at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)

at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:269)

at org.apache.coyote.AbstractProtocol
$AbstractConnectionHandler.process(AbstractProtocol.java:515)

at org.apache.tomcat.util.net.JIoEndpoint
$SocketProcessor.run(JIoEndpoint.java:300)

at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)

at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)

at java.lang.Thread.run(Thread.java:662)



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



Re: PageMap locking...

2011-10-24 Thread Igor Vaynberg
you shouldnt have requests that take a long time to process. there are
lots of problems with this like users starving your threadpool, etc.

instead you should load the data in another thread and either use a
push notification or let the client poll to find out if the data is
available.

unfortunately the ajaxlazyloadpanel is not implemented correctly, it
doesnt poll but simply request and wait for the data with ajax.

a better implementation might look like this and might better work for
what you need:

class BetterLazyLoadPanel extends Panel {
   public BetterLazyLoadPanel() {
   add(new WebMarkupContainer("content")); <-- placeholder until
the right component is added
   add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(2)) {
  onTimer(target) {
 Component replacement=getLazyLoadedComponent("content");
 if (replacement!=null) {
replace(replacement);
stop();
target.add(BetterLazyLoadPanel.this);
 }
  }
   });
   }

   protected abstract getLazyLoadedComponent(String id);
}

now in getLazyLoadedComponent() you can return null until your data
has finished loading in another thread, and when its done return the
component you wish to represent it with. hope this helps.

-igor


On Sun, Oct 23, 2011 at 9:06 AM, YaronHolland  wrote:
> We have some pages that might take a long time to load, depanding on data.
>
> Once the user has clicked a link to another page (Or switched a tab if it is
> a tabed page), is there a way to terminate the request to prevent a load on
> the server for a page that will not be displayed?
>
> In a tabed page, is there a way to go to another tab without waiting for the
> first tab to rendered? (As the tab link is waiting to the page map to be
> relased...)
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/PageMap-locking-tp3930623p3930623.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
>
>

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



Re: PageMap locking...

2011-10-24 Thread YaronHolland
How can i delegate to another PageMap when i need it on a panel in a tabed
page?

The PageMap is declared in the page, how can i use a diffrent PageMap for a
tab in the page?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PageMap-locking-tp3930623p3932904.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



Re: PageMap locking...

2011-10-24 Thread jcgarciam
If you are using wicket 1.4, you should be able to delegate your long
running request to work with a different pageMap.


On Mon, Oct 24, 2011 at 6:16 AM, YaronHolland [via Apache Wicket] <
ml-node+s1842946n3932536...@n4.nabble.com> wrote:

> Actually using lazy panel makes the problem worse, now the user can click
> on the tabs, but they will not work as they wait to the lazy panel to
> complete...
>
> We need to allow to move to another tab, without waiting for the first tab
> to be rendered.
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/PageMap-locking-tp3930623p3932536.html
>  To unsubscribe from Apache Wicket, click 
> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=>.
>
>



-- 

JC


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PageMap-locking-tp3930623p3932867.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



RE: PageMap locking...

2011-10-24 Thread YaronHolland
Actually using lazy panel makes the problem worse, now the user can click on
the tabs, but they will not work as they wait to the lazy panel to
complete...

We need to allow to move to another tab, without waiting for the first tab
to be rendered.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PageMap-locking-tp3930623p3932536.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



RE: PageMap locking...

2011-10-24 Thread Wilhelmsen Tor Iver
> Once the user has clicked a link to another page (Or switched a tab if it is
> a tabed page), is there a way to terminate the request to prevent a load on
> the server for a page that will not be displayed?

Normally: no, because these are separate requests. The first request will 
cancel only when it tries to write to the (now closed, unless keepalive is 
used) stream to the browser.

> In a tabed page, is there a way to go to another tab without waiting for the
> first tab to rendered? (As the tab link is waiting to the page map to be
> relased...)

You can alleviate the problem by delegating the long rendering operation to the 
AjaxLazyLoadPanel mechanism. Then the page itself is rendered quickly but with 
an indicator for the Ajax-loaded real panel rendering.

- Tor Iver

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



PageMap locking...

2011-10-23 Thread YaronHolland
We have some pages that might take a long time to load, depanding on data.

Once the user has clicked a link to another page (Or switched a tab if it is
a tabed page), is there a way to terminate the request to prevent a load on
the server for a page that will not be displayed?

In a tabed page, is there a way to go to another tab without waiting for the
first tab to rendered? (As the tab link is waiting to the page map to be
relased...)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PageMap-locking-tp3930623p3930623.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



Re: pagemap locking

2010-04-28 Thread Frank van Lankvelt
yeah, that's why I thought that I would be safe when only dispatching events
during the request processing to a page from the page-map.

thanks, Frank


On Wed, Apr 28, 2010 at 4:48 PM, Igor Vaynberg wrote:

> most likely this concurrent access happens when you are iterating over
> pages in the pagemap and invoking listeners on them and another thread
> access one of the pages you are iterating over. you will have to lock
> your iteration loop on the same lock wicket uses. as a rule of thumb
> we do not recommend accessing pages in the pagemap yourself...
>
> -igor
>
> On Wed, Apr 28, 2010 at 6:44 AM, Frank van Lankvelt
>  wrote:
> > Hi all,
> >
> > hoping to get some debugging tips on a concurrency issue I've run into.
> >  What we're seeing is concurrent access to a Page instance, when our
> > application is under a lot of stress.
> >
> > The backend is taking a lot of time, which should be handled by Wicket by
> > locking on the pagemap.  This is what I see in the (wicket) code and
> appears
> > to be working fine in ordinary circumstances.  (i.e. request being
> aborted
> > after a minute)
> >
> > What's probably funny about our application is that multiple pages from
> the
> > same pagemap can be involved in one request cycle. After handling the
> > action, but before rendering, we process events that have been delivered
> to
> > the session.  This involves invoking listeners on different page
> instances.
> >  (we're not serializing pages to disk)
> >
> > I'm happy to give more details of the way we use wicket (it's all open
> > source anyway), but perhaps there are some gotcha's that I've been
> missing.
> >  Does anyone have a clue?
> >
> > thanks, Frank
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: pagemap locking

2010-04-28 Thread Igor Vaynberg
most likely this concurrent access happens when you are iterating over
pages in the pagemap and invoking listeners on them and another thread
access one of the pages you are iterating over. you will have to lock
your iteration loop on the same lock wicket uses. as a rule of thumb
we do not recommend accessing pages in the pagemap yourself...

-igor

On Wed, Apr 28, 2010 at 6:44 AM, Frank van Lankvelt
 wrote:
> Hi all,
>
> hoping to get some debugging tips on a concurrency issue I've run into.
>  What we're seeing is concurrent access to a Page instance, when our
> application is under a lot of stress.
>
> The backend is taking a lot of time, which should be handled by Wicket by
> locking on the pagemap.  This is what I see in the (wicket) code and appears
> to be working fine in ordinary circumstances.  (i.e. request being aborted
> after a minute)
>
> What's probably funny about our application is that multiple pages from the
> same pagemap can be involved in one request cycle. After handling the
> action, but before rendering, we process events that have been delivered to
> the session.  This involves invoking listeners on different page instances.
>  (we're not serializing pages to disk)
>
> I'm happy to give more details of the way we use wicket (it's all open
> source anyway), but perhaps there are some gotcha's that I've been missing.
>  Does anyone have a clue?
>
> thanks, Frank
>

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



pagemap locking

2010-04-28 Thread Frank van Lankvelt
Hi all,

hoping to get some debugging tips on a concurrency issue I've run into.
 What we're seeing is concurrent access to a Page instance, when our
application is under a lot of stress.

The backend is taking a lot of time, which should be handled by Wicket by
locking on the pagemap.  This is what I see in the (wicket) code and appears
to be working fine in ordinary circumstances.  (i.e. request being aborted
after a minute)

What's probably funny about our application is that multiple pages from the
same pagemap can be involved in one request cycle. After handling the
action, but before rendering, we process events that have been delivered to
the session.  This involves invoking listeners on different page instances.
 (we're not serializing pages to disk)

I'm happy to give more details of the way we use wicket (it's all open
source anyway), but perhaps there are some gotcha's that I've been missing.
 Does anyone have a clue?

thanks, Frank


AW: Pagemap locking issue

2009-04-23 Thread Tokalak Ahmet
Thanks for your feedback Martijn. 
Yes, you're right. I will solve this issue using threads.






Von: Martijn Dashorst 
An: users@wicket.apache.org
Gesendet: Donnerstag, den 23. April 2009, 10:59:39 Uhr
Betreff: Re: Pagemap locking issue

Why would you want your users to wait for 1 minute to get results? On
what planet and time/space continuum do you expect users to wait for
that?

Don't do the computation in the request thread. Compute the stuff in a
separate thread, process or whatever and subscribe the user's
session/page/whatever to a future outcome of that thread, and then
rendering that directly.

Sounds more like an application design issue than anything related to wicket.

Martijn

On Thu, Apr 23, 2009 at 10:06 AM, Tokalak Ahmet  wrote:
> Hi all,
>
> i'm developing a wicket application, in which i have to lookup mutiple tables 
> with millions of datasets depending of the user inputs.
> Any operation on these tables is very time consuming not to talk about join 
> operations ... (A request can take a few seconds or some minutes to complete)
>
> Since we have changed to production mode we are facing very often with 
> pagemap locking errors which is big annoyance.
>
> I have increased the timeout value using 
> getRequestCycleSettings().setTimeout(Duration.minutes(10)), which isn't a 
> solution.
>
> The problem ist that long running requests block new requests (some requests 
> running undefinitely long?).
> In our application we see that long running time consuming requests are 
> blocking the whole application (tomcat).
> I think that long running request should be aborted after the timeout.
> This is a severe problem for us and could lead to the decision to give up 
> Wicket.
> Does anybody has any idea to solve this problem?
> Thanks in advance.
>
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.5 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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


  

Re: Pagemap locking issue

2009-04-23 Thread Martijn Dashorst
Why would you want your users to wait for 1 minute to get results? On
what planet and time/space continuum do you expect users to wait for
that?

Don't do the computation in the request thread. Compute the stuff in a
separate thread, process or whatever and subscribe the user's
session/page/whatever to a future outcome of that thread, and then
rendering that directly.

Sounds more like an application design issue than anything related to wicket.

Martijn

On Thu, Apr 23, 2009 at 10:06 AM, Tokalak Ahmet  wrote:
> Hi all,
>
> i'm developing a wicket application, in which i have to lookup mutiple tables 
> with millions of datasets depending of the user inputs.
> Any operation on these tables is very time consuming not to talk about join 
> operations ... (A request can take a few seconds or some minutes to complete)
>
> Since we have changed to production mode we are facing very often with 
> pagemap locking errors which is big annoyance.
>
> I have increased the timeout value using 
> getRequestCycleSettings().setTimeout(Duration.minutes(10)), which isn't a 
> solution.
>
> The problem ist that long running requests block new requests (some requests 
> running undefinitely long?).
> In our application we see that long running time consuming requests are 
> blocking the whole application (tomcat).
> I think that long running request should be aborted after the timeout.
> This is a severe problem for us and could lead to the decision to give up 
> Wicket.
> Does anybody has any idea to solve this problem?
> Thanks in advance.
>
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.5 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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



Pagemap locking issue

2009-04-23 Thread Tokalak Ahmet
Hi all,

i'm developing a wicket application, in which i have to lookup mutiple tables 
with millions of datasets depending of the user inputs. 
Any operation on these tables is very time consuming not to talk about join 
operations ... (A request can take a few seconds or some minutes to complete)

Since we have changed to production mode we are facing very often with pagemap 
locking errors which is big annoyance.

I have increased the timeout value using 
getRequestCycleSettings().setTimeout(Duration.minutes(10)), which isn't a 
solution.

The problem ist that long running requests block new requests (some requests 
running undefinitely long?).
In our application we see that long running time consuming requests are 
blocking the whole application (tomcat). 
I think that long running request should be aborted after the timeout. 
This is a severe problem for us and could lead to the decision to give up 
Wicket.
Does anybody has any idea to solve this problem? 
Thanks in advance.