Re: [rules-users] StatefulKnowledgeSession leaves threads running

2009-07-17 Thread Mark Proctor
Rafael Ribeiro wrote: Hi all, I've downloaded Drools fusion sample and started to make some changes to the code (first of all wipe out the UI so I can test it easier). I tried to get to a minimal set so I can run a console main class and see what happens but I am facing a strange

Re: [rules-users] StatefulKnowledgeSession leaves threads running

2009-07-17 Thread Edson Tirelli
The problem here is a different one. The engine is calling shutdown() on a thread pool and even without any task being executed, the thread is blocked in an internal JDK queue waiting for the timeout. I replaced the call by shutdownNow(), forcing the jdk to signal an interrupt to the thread

Re: [rules-users] StatefulKnowledgeSession leaves threads running

2009-07-17 Thread Rafael Ribeiro
Edson: Is it a code change inside Drools or is there any other shutdown method that I may call ? Mark: I completely agree with this future change, it makes much sense in an AppServer environment where we shouldn't be handling thread creation and disposal by ourselves. regards, Rafael

Re: [rules-users] StatefulKnowledgeSession leaves threads running

2009-07-17 Thread Edson Tirelli
Rafael, It is the JDK class: Class ScheduledThreadPoolExecutor Check the API for methods shutdown() and shutdownNow(). I am also looking at the JDK source code. It seems safe in our case to change the call to shutdownNow() instead of the previous call to shutdown(). The shutdown is

[rules-users] StatefulKnowledgeSession leaves threads running

2009-07-16 Thread Rafael Ribeiro
Hi all, I've downloaded Drools fusion sample and started to make some changes to the code (first of all wipe out the UI so I can test it easier). I tried to get to a minimal set so I can run a console main class and see what happens but I am facing a strange behaviour. As soon as I start

Re: [rules-users] StatefulKnowledgeSession leaves threads running

2009-07-16 Thread Edson Tirelli
Hi Rafael, Are you setting the MultithreadEvaluation option or is this using default options? Do you have an example code that shows this behavior? Thanks, Edson 2009/7/16 Rafael Ribeiro rafae...@gmail.com Hi all, I've downloaded Drools fusion sample and started to make some

Re: [rules-users] StatefulKnowledgeSession leaves threads running

2009-07-16 Thread Rafael Ribeiro
Hi Edson! as I've already mentioned I've modified the sample so, if you get the StockTick sample and replace the Main class this will run fine. The sample shuts down fine but as I saw it sets the JFrame uses frame.setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE ); which in turn makes

Re: [rules-users] StatefulKnowledgeSession leaves threads running

2009-07-16 Thread Greg Barton
the fireUntilHalt() would exit, but the VM would not exit due to a non-daemon thread persisting. --- On Thu, 7/16/09, Rafael Ribeiro rafae...@gmail.com wrote: From: Rafael Ribeiro rafae...@gmail.com Subject: Re: [rules-users] StatefulKnowledgeSession leaves threads running To: Rules Users List