java.lang.Thread.State: BLOCKED at lucee.runtime.op.date.DateCaster.toDateAdvanced

Description

dateFormat() and timeFormat() accept dates, but also strings (even empty strings). Then Lucee tries to cast these strings internally into date objects. This internal casting happens in a synchronized method. See screenshot.

So the questions are: Must this method be synchronized? Should Lucee accept everything as input, not only date objects?


In our load tests with strings as arguments, we had massive issues with blocked requests.


http-apr-8080-exec-31" Id=1325 BLOCKED on [Ljava.text.SimpleDateFormat;@692f671c owned by "http-apr-8080-exec-182" Id=27277
java.lang.Thread.State: BLOCKED
at lucee.runtime.op.date.DateCaster.toDateAdvanced(DateCaster.java:151)

waiting to lock [Ljava.text.SimpleDateFormat;@692f671c owned by "http-apr-8080-exec-182"
at lucee.runtime.op.date.DateCaster._toDateAdvanced(DateCaster.java:447)
at lucee.runtime.op.date.DateCaster.toDateAdvanced(DateCaster.java:436)
at lucee.runtime.op.Caster.toDate(Caster.java:2843)
at lucee.runtime.functions.displayFormatting.TimeFormat._call(TimeFormat.java:66)
at lucee.runtime.functions.displayFormatting.TimeFormat.call(TimeFormat.java:57)
at core.newsroom.listorder_cfc$cf.udfCall(/contenscms/core/newsroom/listorder.cfc:91)
at api.service.newslist_cfc$cf.udfCall1(/contenscms/api/service/newslist.cfc:22)
at api.api_cfc$cf.udfCall(/contenscms/api/api.cfc:98)
at api.restapi_cfc$cf.udfCall(/contenscms/api/restapi.cfc:72)
at contens.api.rpcendpoint_cfm$cf.call(/contens/api/rpcendpoint.cfm:27)
...

locked org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@a1bb395
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

Locked ownable synchronizers:

  • java.util.concurrent.ThreadPoolExecutor$Worker@5f42b42```

Environment

Assignee

Unassigned

Reporter

Harry Klein

Priority

Major

Labels

None

Fix versions

Sprint

None

Affects versions

Configure