Errors/timeouts occur if using threads via the java concurrency framework (JCF)

Description

Hi there Lucee team,

I encountered errors and request timeouts while using the java concurrency framework (not pure threads)

Basically the following is done:

  • ThreadPoolExecutor is created

  • a task is submitted and the request completes normally

  • the task runs fine (async in a created thread, just sleeping for 10s) and completes normally

  • after the task is completed some time goes by (to be more specific the amount of time specified in the request timeout in the lucee admin)

  • Errors show up in the requesttimeout.log as well as in the Console

Find a Mini-Test-Application attached. Just extract it somewhere in a folder beneath the webroot and call the index.cfm. Then watch the Console and requesttimeout.log.

I don't understand why the request timeout kicks in as the task is already completed. Even if the task itself running in a thread would take longer than the request timeout, the timeout should not be applied IMHO. And in the example neither the request that creates the thread pool nor the task that the thread runs takes longer than the request timeout.
It is obvious that the ThreadPoolExecutor might hold threads in a thread pool (for reuse). That' its job.

Did I do something wrong? Why does Lucee care about the threads in the pool and tries to stop them at all?

You can also try out Marc Esher's cfconcurrent framework and get the same results. Just try one or more of the sample apps that ship with the framework code. I don't think that this is intended behaviour.
https://github.com/marcesher/cfconcurrent

Right now my workaround is to set the request timeout to a very high number in the request that creates the thread pool (and hope that the application is restarted before the timeout occurs). it might also help to set the request time out within the thread that is created. But this is only a workaround and I do not think that this should be necessary. As mentioned neither the request that creates the thread pool nor one of the single threads takes long processing time.

For reference, these are two forum topics as well as a cfconcurrent issue I created (actually I first saw the problem while using Marc's framework)
https://groups.google.com/forum/m/#!topic/lucee/sFKrlGPJ1Xc
https://groups.google.com/forum/m/#!topic/lucee/KPGiH9zF5C8
https://github.com/marcesher/cfconcurrent/issues/3

Help or a fix is much appreciated. And please keep up the excellent work!

Best regards,
Jan

Environment

lucee express edition, OSX, both JDK7 and 8 tried

Attachments

1

Activity

Show:

Zac Spitzer 15 June 2024 at 15:49

Jan Jannek 9 November 2018 at 10:36

Hi ,

tried this yesterday using very latest 5.2. The NoClassDefFoundError is gone and the test application seems to work (no request time out kicks in). So basically this issue is considered solved.
But one follow-up issue tighly related popped up.
I tried to run the cfconcurrent examples (mentioned above in the issue description).
Some of them do not work as now we cannot create a dynamic proyy using the java.util.concurrent.Callable interface.
Would be great if this gets fixed.

Thanks,
Jan

Jan Jannek 9 March 2018 at 10:17

Hi ,

Tested yesterday (latest 4.5 and 5) and also see the mentioned problems. Not sure why java.lang.Runnable is not found. Should be perfectly valid code.

Jan

Pothys - MitrahSoft 9 March 2018 at 08:53

Hi ,

I've found that still the issue 4.5.5.013 final version. In lucee 5 latest throw "java.lang.NoClassDefFoundError" error. Can you able to run on test file onlucee5 & still the issue present in lucee 5?

Jan Jannek 8 March 2018 at 14:12

Hi,

The Lucee 5 related issue seems to be related to this: https://luceeserver.atlassian.net/browse/LDEV-826
It would be great if there would be any progress on this.

Thanks,
Jan

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 23 October 2015 at 18:21
Updated 12 November 2024 at 10:29