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
Firebird's internal timer incorrectly resets existing timer entries [CORE6182] #6427
Comments
Modified by: @hvladassignee: Vlad Khorsun [ hvlad ] |
Commented by: @hvlad I can't reproduce the issue. This is what i see ==================================================================== SOURCE_DTS 2019-11-05 20:40:21.9130 DTS1 2019-11-05 20:40:22.0740 SOURCE_DTS 2019-11-05 20:40:30.0790 DTS1 2019-11-05 20:40:30.2150 SOURCE_DTS 2019-11-05 20:40:38.2190 DTS1 2019-11-05 20:40:38.3600 SOURCE_DTS 2019-11-05 20:40:46.3640 DTS1 2019-11-05 20:40:46.5130 Use CONNECT or CREATE DATABASE to specify a database CONCATENATION Point before DROP C:\TEMP\TMP4EDS_01.FDB: 2019-11-05 20:40:54.6610 drop database; CONCATENATION Point before DROP C:\TEMP\TMP4EDS_02.FDB: 2019-11-05 20:40:54.7970 drop database; CONCATENATION Point before DROP C:\TEMP\TMP4EDS_03.FDB: 2019-11-05 20:40:54.8930 drop database; CONCATENATION Point before DROP C:\TEMP\TMP4EDS_04.FDB: 2019-11-05 20:40:55.0910 drop database; ==================================================================== i.e. databases 01 and 02 was dropped succesfully and 03 and 04 failed to drop due to presence of (idle) external connections to it. Note, external connection become idle not when its statement is executed but when local transaction is finished. All works as expected. |
Commented by: @pavel-zotov In your result I see that there was no error when script did this:CONCATENATION Point before DROP C:\TEMP\TMP4EDS_01.FDB: 2019-11-05 20:40:54.6610 drop database;
|
Modified by: @pavel-zotovAttachment: c6182-check.png [ 13398 ] |
Commented by: @pavel-zotov PS. WI-T4.0.0.1639 Firebird 4.0 Beta 1 |
Commented by: @hvlad The issue is reproducidble with Legacy_Auth plugin. The real problem is inside TimerControl implementation in Firebird. Legacy_Auth plugin creates own timer to release cached connection to the security database. Looks like the same issue was described at CORE6082 |
Commented by: @hvlad The issue with timers should be present in v3 also. |
Modified by: @hvladstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0.5 [ 10885 ] Fix Version: 4.0 Beta 2 [ 10888 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Done successfully |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovstatus: Closed [ 6 ] => Closed [ 6 ] QA Status: Done successfully => Done with caveats Test Details: Currently test is only for FB 4.0. One need to found other test case for FB 3.x because ExpPool feature not accessible there. |
Modified by: @dyemanovsummary: ExtConnPoolLifeTime acts as countdown for activity in MOST RECENT database (of several) rather then separate for each of used databases => Firebird's internal timer incorrectly resets existing timer entries |
Submitted by: @pavel-zotov
Attachments:
c6182-check.png
According to %FB4_HOME%\doc\sql.extensions\README.external_connections_pool, parameter ExtConnPoolLifeTime is "idle connection lifetime, seconds".
It seems that if 'main' database performs PSQL which uses EDS to several (>=2) different databases then value of ExtConnPoolLifeTime is applied to the LAST moment when activity was, regardless to some concrete database.
Connection(s) to some DB that was handled before any others will exist until *all* activity will gone, rather than to *this* ("earliest") DB.
Steps to reproduce:
1) prepare firebird.conf:
Servermode = Super # or SuperClassic
ExtConnPoolSize = 10
ExtConnPoolLifeTime = 10
2) restart FB if it is running as service;
3) run following script (change path and names of temp databases if needed):
=======
Console will be filled with messages
SOURCE_DTS 2019-11-03 14:28:41.4960
SOURCE_DB C:\TEMP\TMPMAIN.FDB
TARGET_DB C:\TEMP\TMP4EDS_01.FDB
TARGET_DTS 2019-11-03 14:28:41.9100 -------------------------------------------------------- [ 1 ]
. . .
SOURCE_DTS 2019-11-03 14:29:06.5020
SOURCE_DB C:\TEMP\TMPMAIN.FDB
TARGET_DB C:\TEMP\TMP4EDS_04.FDB
TARGET_DTS 2019-11-03 14:29:06.7940
-- and after this:
CONCATENATION Point before DROP C:\TEMP\TMP4EDS_01.FDB: 2019-11-03 14:29:14.8240 --------------------- [ 2 ]
drop database;
Statement failed, SQLSTATE = 40001
lock time-out on wait transaction
-object C:\TEMP\TMP4EDS_01.FDB is in use
So, we can see here that:
1) last ctivity in TMP4EDS_01.FDB was at "2019-11-03 14:28:41.9100" (see line marked as "[ 1 ]" )
2) attempt to drop this DB was at 2019-11-03 14:29:14.8240 ( line "[ 2 ]" )
datediff() between these values is ~33 seconds. This is much more than 10 seconds which was assigned to ExtConnPoolLifeTime.
Commits: 1c13dbb 0d33f4e
====== Test Details ======
Currently test is only for FB 4.0. One need to found other test case for FB 3.x because ExpPool feature not accessible there.
The text was updated successfully, but these errors were encountered: