[weld-issues] [JBoss JIRA] Commented: (WELDSERVLET-6) Conversation should work on AppEngine

Paul Bakker (JIRA) jira-events at lists.jboss.org
Wed Apr 21 05:31:11 EDT 2010


    [ https://jira.jboss.org/jira/browse/WELDSERVLET-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12526736#action_12526736 ] 

Paul Bakker commented on WELDSERVLET-6:
---------------------------------------

How did you test this? I just built Weld from the trunk but it still doesn't work (neither on the development server and the production server). If I look at the code I still find  the following in SingleThreadScheduledExecutorServiceFactory:

*code*
 this.executorService = Executors.newScheduledThreadPool(1);
*code*

and in AbstractConversationManager:
*code*
 private Future<?> scheduleForTermination(String cid, long timeout)
   {
      Runnable terminationTask = new TerminationTask(cid);
      return Container.instance().services().get(ScheduledExecutorServiceFactory.class).get().schedule(terminationTask, timeout, TimeUnit.MILLISECONDS);
   }
*code*

Calling schedule on a ScheduledExecutorService is not possible on AppEngine as far as I know. I tested this with the following code too in a plain servlet:

*code*
ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor();
		Runnable r = new Runnable() {
			
			@Override
			public void run() {
				System.out.println("test");
				
			}
};
	
//Throws exception	
exec.schedule(r, 5, TimeUnit.SECONDS);
*code*

Although this code creates a single thread, it's still an extra thread, and that's not allowed by AppEngine. I think Pete's solution is the only way (using the task queue).


> Conversation should work on AppEngine
> -------------------------------------
>
>                 Key: WELDSERVLET-6
>                 URL: https://jira.jboss.org/jira/browse/WELDSERVLET-6
>             Project: Weld Servlet
>          Issue Type: Feature Request
>         Environment: Google AppEngine 1.3
>            Reporter: Paul Bakker
>            Assignee: Matija Mazi
>            Priority: Optional
>
> Weld works pretty well on GAE, which is of course great in combination with JSF 2. The only problem I've ran into so far is that conversations don't work. GAE doesn't allow threading, and the cleanup scheduler in Weld brakes this rule. 
> The problem is in org.jboss.weld.conversation.AbstractConversationManager.scheduleForTermination(AbstractConversationManager.java:204)
> This is obviously not a bug, it's just a GAE problem. I'm not sure how this should be solved in a clean way, disabling the cleanup task when running on GAE seems like a bad idea (memory leaks). It might be an idea to create a GAE task queue for cleanup, but this would require  GAE specific code.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list