-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[9.2] Before a user is getting scanned the database connection is re-establ… #25853
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
[9.2] Before a user is getting scanned the database connection is re-establ… #25853
Conversation
|
@DeepDiver1975, thanks for your PR! By analyzing the annotation information on this pull request, we identified @icewind1991, @mmattel and @bartv2 to be potential reviewers |
| } | ||
| while (!$connection->isConnected()) { | ||
| try { | ||
| $connection->connect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a max retries count to avoid infinite loops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in which case the exception is rethrown to the outside
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave this to the admin then to decide if/when he wants to terminate the scan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, in my mind I saw this method as part of DBConnection but it isn't. Since this loop is only in the context of file scanning then it's fine.
|
👍 |
|
@DeepDiver1975 any chance to have a little unit test that covers the reconnection part, so that CI can tell us that all databases are ok with it ? |
there is not much dbms specific in here - doctrine unsets the connection on close and creates a new connection within connect. |
|
Another concern of mine is whether reconnecting a thousand times is slower than keeping the connection open. If slower, a possible strategy would be to keep track of elapsed time and after every user check if the time is more than a minute or so. If yes, then reconnecting. But if you think the overhead is negligible then I'm fine with this. |
|
@DeepDiver1975 can you check my previous comment ? Would be good to get this merged and backported soon, unless you think this is too risky |
Form my pov this can be ignored |
|
👍 tested with LDAP and 100 users |
|
Jenkins unpublished success message -> merge |
|
@DeepDiver1975 please send the backports, thanks |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
…ished
refs #25480