-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CFConcurrent on Lucee #3
Comments
@jjannek First off, this is a fantastic bug report. Well done. I agree with your conclusion that the thing now is to isolate the problem, and I have a few starter questions: To rule out your own code, let's start with the examples that ship with cfconcurrent. Open http://localhost/cfconcurrent, and then click some of the links to run the examples. If you observe the same behavior as described above, then you've ruled out your own code. I'd imagine that the most likely culprit is cfconcurrent OR railo/lucee and not the JVM, but let's rule that out first b/c it's easiest. Assuming you have another JVM to test with, update the lucee config file to point to it, restart, and see if you observe the same behavior. If you observe the same behavior, you've ruled out the JVM Now's when it gets tricky. Before we try ruling out cfconcurrent, I'm curious what you see in the logs when you run the examples. My first thought when reading your report was just as yours: "why would it be calling stop?" Let's start with the above, see where you get, and then go from there. |
Hi Marc, thank you very much vor the quick answer. Offtopic: I updated the cfconcurrent code locally but was unable to create a pull request. Maybe this is a permission issue? If you give me permissions to create a pull request I am happy to contribute the changes. It could also be the case that I am doing something wrong as this is the first time that I what to contribute code to an open source project on github. Another thing which occurred during experimenting with the examples is that I get the following error if canceling all tasks: Back to the main topic: I also added a topic to the Lucee Google Group. Micha suggests that it's a JDK/Lucee problem. But I guess that we have to deal with multiple things at once. I also found the part in the Lucee Java source which causes the exception to occur. But still it is not clear why Lucee tries to stop the threads at all. Questions are: Any further thoughts? |
off topic: |
Further experiments: Exception in thread "pool-1-thread-1" java.lang.IllegalMonitorStateException The errors in the requesttimeout.log are the same as before. A very basic test to reproduce the problem is the following:
In this particular case 9 Errors are displayed in the Console and the log file. |
@jjannek Thanks again for all the details. Something I'm really curious about: you are trying on Lucee, but can you also try on a recent version of Railo? Back when I developed cfconcurrent -- a long time ago, 2012 -- that would've been Railo 3 era I think. And I remember it worked fine on Railo, no errors like you're describing. So I'd like to see if something changed in the intervening years. If you can try that out and let me know what you learn, we can try to figure out if there are next steps that we can do, aside from hoping the Lucee people have some ideas. |
I gave it a quick try using Railo Express 4.2.1.008 (using Jetty as well). |
Just for information: https://groups.google.com/forum/#!topic/lucee/KPGiH9zF5C8 Let's see where this is heading. Hopefully there is a solution as otherwise cfconcurrent/JCF would be useless in Railo/Lucee. |
FYI: We are running cfconcurrent with fixedRate Tasks on lucee 5.2 and it's working like a charm. Also integration with the coldbox framework was quite easy. Shutdown and restart on app reinit is working fine. The threads controlled by cfconcurrent show up in java melody, so i can confirm that a new threadpool is created on every reinit of the app. |
@phal0r Have you ported this library to ColdBox/WireBox, and if you have can you share your code? I have a ColdBox app, and I would like to use this project, but it would be nice to have that run in a "proper" ColdBox way. |
@evagoras
The task is modeled after the documentation in this project. No special hacks necessary. Also, wirebox works out of the box in the tasks. Tasks run in a separate thread managed by the JVM. That means injecting singletons does not work (I am not 100% sure why). To circumveit this one can inject coldbox itself and then request the singletons via All the initialization takes place in the ModuleConfig.cfc of the module. This works smoothely in Lucee, but craches every Coldfusion version I tested (I think up to Coldfusion 11) with an OutOfMemory-Error after some time running. So, if you run Lucee you should be good to go. Also, this setup is for Coldbox 3.8. I think it will be similar with newer coldbox versions, some adaptions may be necessary. Hope this helps you to get started. |
@phal0r thank you for answering so quickly and for offering your code! That looks really good, will need to give that a go. I am on ACF 2016 and ColdBox 5 though, so my stack is a bit different. I will let you know how it goes. |
Yeah, let me know, how it goes. |
@phal0r I am running into some issues trying to implement your design, and I wonder if it's because I have added things in the wrong place. I am probably asking too much here, but is it possible for you to zip up your module (excluding any proprietary code of course) and send it to my gmail account ([email protected])? Once I get this working I will post the entire code on github for anyone else to pick up. |
Hi Marc,
I am trying to run cfconcurrent on Lucee (Version 4.5.1.008, Express on Jetty) and am having some issues. I am using Java 1.8.0_25 (Oracle Corporation) 64bit on OS X 10.10.3.
I saw the references to Java 7 so I was wondering if there is any compatibility issue when using Java 8. I had a quick look at the javadocs and did not find anything problematic at first sight.
Basically the framework runs just fine, but I am seeing errors in the console and the requesttimeout.log.
It seems that the threads could not be properly stopped - and am unsure why this is even required at all.
I catch and log all errors within my code (big try/catch within the executor's run method), but there is no error catched.
Sidenote:
I had tried out the same configuration but using tomcat instead of jetty. Then the situation gets worse as I was not able to properly shutdown the whole application server. But that's a different case right now. However could be related to the same root cause.
The issue "should" be the same on Railo as Lucee 4.5.1 is a fork and I guess nothing changed in particular this place.
Console:
Exception in thread "Thread-22" java.lang.UnsupportedOperationException
at java.lang.Thread.stop(Thread.java:869)
at lucee.commons.io.StopThread.run(SystemUtil.java:1058)
The "Thread-22" is variable and can contain any number. The rest is always the same.
Looking at the source of the Lucee/Railo Class I can see that lucee calls the thread.stop method and passes in a Throwable argument. According to the java 7 and 8 javadocs the stop method is deprecated as it's unsafe in certain conditions.
So the issue "may" be a Lucee/Railo one.
However I was wondering why lucee is trying to stop a thread at all?!?
requesttimeout.log
"ERROR","Thread-16","04/13/2015","10:34:42","controler","stop thread (4) because run into a timeout (fail to retrieve path:java.lang.NullPointerException:null).;java.lang.Throwable;java.lang.Throwable
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1088)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"
It looks to me as if my code might throw an exception within a thread (timeout).
Is there any default timeout? Or is this related to the default request timeout of ColdFusion/Railo/Lucee?
And do you know whether the "max concurrent threads" setting in the CF/Railo/Lucee admin has an effect on this one? Is this only related to cfthread instances? Or are plain java threads that are created by cfconcurrent also counted against that setting value?
Is a java thread created by JCF/cfconcurrent considered to be a coldfusion request which is kind of strange?
I think cfconcurrent is really a neat framework and I would like to continue working with it. If I can't find out what goes on here, I think I may use plain JCF instead - to get to the root of the problem. But that would be only the second-best solution of course... ;-)
Right now I am really unsure what the source of the errors is:
Any one else having the same issue?
Help is really much appreciated.
Greetings from Germany,
Jan
The text was updated successfully, but these errors were encountered: