Skip to content
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

Srp plugin keeps connection after database has been removed for ~10 seconds (SS and SC). [CORE6441] #2367

Closed
firebird-automations opened this issue Nov 9, 2020 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Attachments:
srp-cached-conn-after-drop-db-with-fixed-name.bat.7z
srp-cached-conn-after-drop-db-with-random-name.bat.7z

Bug was encountered while implementing test for CORE6412.
After discuss with Alex, it was decided to create seperate ticket.

Consider scenario:
0) choose some name for database file; REMOVE this file if it exists

LOOP:
1) create database which are self-security;
2) create user SYSDBA in this database, suing plugin Srp;
3) run ISQL and connect to this DB using TCP protocol, and do some trivial query (say, to mon$ tables). Send STDERR to separate file.
4) exit from ISQL and change state of this DB to full shutdown. Send STDERR to separate file (as on previous step; wil accumulating).
5) if size of STDERR log is greater than 0 - display its content and leave from scenario; otherwise:
6) check attributes from DB header. Line must contain 'full shutdown'
7) REMOVE DATABASE FILE from disk (it always will be successful because of full shutdown state)
8) make some pause, for ~10 seconds
9) LOOP to step "1)".

Run this scenario on SS or SC.
It will run infinitely. So far - so good.

Now reduce pause (see step "8") from 10s to some shorter value, say 4 seconds.
Script will perform successfully only FIRST iteration.

On *second* iteration it will raise:

Statement failed, SQLSTATE = 08006
Error occurred during login, please check server firebird.log for details

And in firebird.log we can see:

Srp Server
connection shutdown
Database is shutdown\.

=====

So, we can not create database when it surely does not exist.
Moreover, we can not create DB with RANDOM name also, not just with "fixed" one (it can be easy checked by assigning to variable !dbnm! something like: set dbnm=c:\temp\tmp4test_!random!.fdb )

Attachments:
srp-cached-conn-after-drop-db-with-fixed-name.bat.7z - when trying to operate with the same DB file on each iter;
srp-cached-conn-after-drop-db-with-random-name.bat.7z -- when DB file is random on each iter.

Commits: 8f49cd7 b4386db FirebirdSQL/fbt-repository@63d37f7

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: srp-cached-conn-after-drop-db-with-fixed-name.bat.7z [ 13503 ]

Attachment: srp-cached-conn-after-drop-db-with-random-name.bat.7z [ 13504 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 RC 1 [ 10930 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Fix Version: 3.0.8 [ 10960 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants