Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Sessions not expiring.
Sessions not expiring. [message #652799] Sun, 06 February 2011 22:26 Go to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
I have an issue in a production app that I can't replicate in a test/dev environment.

I'm running RAP 1.3.0 on JBoss 5.1 with a Sun 1.6.0_22 64 bit jvm.

I've found several scenarios where the issue occurs.
One is related to bug 329302 where a thread deadlock occurs.
The other has no deadlock, but the UIThread's are sitting in Object.wait in the UIThread.switchThread, as they shoud be. The problem is the JBoss thread that invalidates expired threads is stuck waiting for one of the UIThreads to exit in the UIThread.terminateThread method as a result of the session being invalidated.


Here's a sample of the UIThreads, including the one blocking the JBoss thread

"UIThread [293B6357CF6F7EE74652AE935B44D4EB.prod]" daemon prio=10 tid=0x00002aaaf4837000 nid=0x64ac in Object.wait() [0x0000000050a5d000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00002aaacddb2ad0> (a org.eclipse.rwt.internal.lifecycle.UIThread)
	at java.lang.Object.wait(Object.java:485)
	at org.eclipse.rwt.internal.lifecycle.UIThread.switchThread(UIThread.java:60)
	- locked <0x00002aaacddb2ad0> (a org.eclipse.rwt.internal.lifecycle.UIThread)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLifeCycle.java:297)
	at org.eclipse.swt.widgets.Display.sleep(Display.java:1128)
	at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(WorkbenchAdvisor.java:361)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2391)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2351)
	at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2206)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:424)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.jface.internal.databinding.realmadapter.RealmAdapter.run(RealmAdapter.java:44)
	at org.eclipse.rap.ui.internal.RealmAdapterHook.runWithDefault(RealmAdapterHook.java:48)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:427)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
	at nz.bnz.sb.rap.EntryPoint.createUI(EntryPoint.java:92)
	at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:92)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:244)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:113)
	- locked <0x00002aaacddb2ad0> (a org.eclipse.rwt.internal.lifecycle.UIThread)
	at java.lang.Thread.run(Thread.java:619)
	at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)


"UIThread [30A8C37FCBC861501E2E72D910863AEC.prod]" daemon prio=10 tid=0x0000000048ea0000 nid=0x69e9 in Object.wait() [0x000000005186b000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00002aaace27f9a0> (a org.eclipse.rwt.internal.lifecycle.UIThread)
	at java.lang.Object.wait(Object.java:485)
	at org.eclipse.rwt.internal.lifecycle.UIThread.switchThread(UIThread.java:60)
	- locked <0x00002aaace27f9a0> (a org.eclipse.rwt.internal.lifecycle.UIThread)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLifeCycle.java:297)
	at org.eclipse.swt.widgets.Display.sleep(Display.java:1128)
	at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(WorkbenchAdvisor.java:361)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2391)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2351)
	at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2206)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:424)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.jface.internal.databinding.realmadapter.RealmAdapter.run(RealmAdapter.java:44)
	at org.eclipse.rap.ui.internal.RealmAdapterHook.runWithDefault(RealmAdapterHook.java:48)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:427)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
	at nz.bnz.sb.rap.EntryPoint.createUI(EntryPoint.java:92)
	at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:92)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:244)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:113)
	- locked <0x00002aaace27f9a0> (a org.eclipse.rwt.internal.lifecycle.UIThread)
	at java.lang.Thread.run(Thread.java:619)
	at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)


Every stack trace for the other UIThreads are identical, except for the obvious name, thread id, object id's etc

This is the JBoss thread that invalidates the expired sessions
"ContainerBackgroundProcessor[StandardEngine[jboss.web]]" daemon prio=10 tid=0x00000000480ab000 nid=0x19b3 in Object.wait() [0x000000004ae01000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00002aaacddb2ad0> (a org.eclipse.rwt.internal.lifecycle.UIThread)
	at java.lang.Thread.join(Thread.java:1143)
	- locked <0x00002aaacddb2ad0> (a org.eclipse.rwt.internal.lifecycle.UIThread)
	at java.lang.Thread.join(Thread.java:1196)
	at org.eclipse.rwt.internal.lifecycle.UIThread.terminateThread(UIThread.java:118)
	at org.eclipse.rwt.internal.lifecycle.UIThread.interceptShutdown(UIThread.java:148)
	at org.eclipse.rwt.internal.service.SessionStoreImpl.valueUnbound(SessionStoreImpl.java:160)
	at org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1649)
	at org.apache.catalina.session.StandardSession.expire(StandardSession.java:756)
	- locked <0x00002aaacdc62a58> (a org.apache.catalina.session.StandardSession)
	at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:592)
	at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:683)
	at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:668)
	at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1327)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1612)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1621)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1621)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1601)
	at java.lang.Thread.run(Thread.java:619)


a head dump hasn't revealed much to me.

All UIThread.uiThreadTerminating fields are false which indicates the thread should have thrown a UIThreadTerminatedError

Nowhere in my code is there a catch(Throwable...) without logging so I am fairly sure I haven't caught the exception by mistake.
Re: Sessions not expiring. [message #652940 is a reply to message #652799] Mon, 07 February 2011 17:05 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Chris,

> [...]
> All UIThread.uiThreadTerminating fields are false which indicates the
> thread should have thrown a UIThreadTerminatedError

I don't understand this conclusion. The uiThreadTerminating field is
false by default, so it might well be that these sessions are still
active. Do you have any other method of distinguishing expired sessions
from active ones?

Are you using a UICallBack in your application?

Regards, Ralf

--
Ralf Sternberg

Twitter: @ralfstx
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Sessions not expiring. [message #653199 is a reply to message #652940] Tue, 08 February 2011 20:42 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
My conclusion around the uiThreadTerminating field is based on the ContainerBackgroundProcessor thread having already entered the method UIThread.terminateThread and sitting on getThread().join(); which means it has passed the line "uiThreadTerminating = true;"

The only other places where this field is set back to false is in the terminateThread method after the getThread().join() has completed and in the handleInterruptInSwitchThread method, immediately before the UIThreadTerminatedError error is thrown
Re: Sessions not expiring. [message #653212 is a reply to message #652940] Tue, 08 February 2011 21:37 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
And yes, I use UICallbacks. None were active at this time as far as I can tell.
The field org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler. IdManager.ids.size for every instance of IdManager is 0
Re: Sessions not expiring. [message #653327 is a reply to message #653212] Wed, 09 February 2011 11:37 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Chris,

I currently have no good guess what might cause this problem. From your
description, it sounds to me like a catched UIThreadTerminatedError, but
you already said that you checked for it. Let me ask anyway: is there any
redirection involved in your application startup?

If not, have you tried to reproduce the problem with a 1.4 runtime? If it
happens with 1.4 too, please open a new bug with a snippet / description
to reproduce it.

Best regards, Ralf

--
Ralf Sternberg

Twitter: @ralfstx
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:RAP product deployment?
Next Topic:How can I change Platform.getNL() ?
Goto Forum:
  


Current Time: Thu Apr 25 15:49:40 GMT 2024

Powered by FUDForum. Page generated in 0.03290 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top