Issues

Select view

Select search mode

 

cfstoredproc timeout not working correctly

Description

Copying this from observations I made on Slack.

Context:

the timeout param on <cfstoredproc> ( ). At the timeout, does this send some sort of "terminate" request to the DB server to kill the proc, or does Lucee simply stop waiting for the DB to come back (and in the background, the proc is still churning away on the DB server).

I might try to come up with some sort of test to find out, but just wondered if someone knows?

It'd be great if this sort of thing was in the docs, rather than just "timeout for the stored procedure.", which is just stating the obvious, and not even really worth saying, I think.

 

Testing:

OK, I don't think the timeout attribute works reliably. But... my knowledge of JDBC & MySQL procs beyond "they are def both things that exist" is minimal. I concocted a test:

So does a wee loop and inserts a record every second for 10sec.

This should timeout after 5sec.Result (after ten seconds):


OK so more findings here. The above test was on MariaDB, and I tested it on MySQL this morning: same results. The timeout doesn't work on Lucee.

As a control I performed the equiv test on CF, and it works exactly how I'd expect it to:
a) the proc call times-out at 5sec
b) it stops the proc running too, ie: it doesn't just "hang-up" on it, and leave the DB to finish in its own time.

So I'm calling this a Lucee bug.

Environment

None

Attachments

3

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 5 August 2022 at 10:07
Updated 11 August 2022 at 08:11

Activity

Show:

Pothys - MitrahSoft11 August 2022 at 08:11

thanks for your checking on this.

Yes, I checked this issue with MySQL/MariaDB and confirm that the timeout doesn't work in MySQL. whatever the timeout sets(below the execution time) it errored after the 10 sec and inserted 10 records into the table.

Also, the timeout works in MariaDB as expected. If set the timeout to 1 sec then the error occured within 2 sec and only 2 records got inserted.

Seems the timeout doesn't work on MySQL with ACF too.

Adam Cameron10 August 2022 at 18:29
Edited

Just chatting to Alex offline about this and re-ran the previous MySQL req (the queryexecuteone). The one that was not timing out, and was taking 10sec to run.

Now it’s timing out @ 5sec as one would like.

So… erm… that’s interesting.

The PROC version is still broke on MySQL though. This has not changed.

Alex Skinner10 August 2022 at 18:14

Interesting if you try setting the timeout to 11 does it then not get timed out to 20 seconds.

I wonder whether Lucee is having a periodic check or something to see whether there is some stuff to timeout.

Also in both instances where you try this on ACF vs Lucee does Mysql show the process no longer running on the DB once timeout has been initiated but on the Lucee called version it is still showing as running on the DB regardless of what Lucee is up to ?

Adam Cameron10 August 2022 at 18:12
Edited

:

So that timeout is not being respected either. This is on MySQL.


Update:

On MariaDB it is respected though.

Adam Cameron10 August 2022 at 18:05
Edited

OK can still reproduce on MySQL. Am running this code:

And the output is:


Note how it only errors-out after 10sec. And it did insert all 10 rows, so the proc was NOT aborted. Also note the error message is different from the one I initially raised.

Full stack trace:

And the text version of the error, for searchability:

Flag notifications