on 2019 Nov 03 8:02 AM
This is a rewrite/repost of How do I debug FORWARD TO creating a persistent idle connection?.
Recap: After a recent patch was applied to Foxhound 4, it began creating a second idle persistent connection to each remote server target database after the Monitor Options page is used on that target.
Testing determined that the first FORWARD TO operation in the Monitor Options code creates the second idle persistent connection.
Further testing narrowed down the original cause to this single statement added by the patch:
CALL sa_set_http_option ( 'SessionID', @new_session_id );
In particular, when that single statement IS EXECUTED, much later FORWARD TO operations DO CREATE second connections to each remote server (Foxhound target database).
Whan that statement IS BYPASSED, the much later FORWARD TO operations DO NOT create second connections to each remote server.
Here is a code excerpt showing the context; this code is (optionally) executed once when the user wants to change from "read only" mode to "updatable by administrator" mode, and is part of the new "Foxhound Administrator Login" feature implemented by the patch:
CREATE SERVICE rroad_administrator_login TYPE 'RAW' AUTHORIZATION OFF USER DBA_menu AS CALL rroad_administrator_login(); CREATE PROCEDURE rroad_administrator_login() RESULT ( html_output LONG VARCHAR ) BEGIN ... DECLARE @new_session_id VARCHAR ( 128 ); ... SET @new_session_id = STRING ( 'foxhound4_session_', SECONDS ( CURRENT TIMESTAMP ), DATEPART ( MILLISECOND, CURRENT TIMESTAMP ) ); CALL sa_set_http_option ( 'SessionID', @new_session_id );
FYI since 2013 Foxhound 4 has executed with SET OPTION PUBLIC.extern_login_credentials option = 'Login_user' which answers one question raised by this forum post Why am I getting extern login errors and/or more than one connection to a remote server with SA 16?
Waiving a dead chicken over the keyboard (setting extern_login_credentials option = 'Effective_user') worked as might be expected; i.e., not at all 🙂
THIS IS NOT A BIG DEAL... I can live with a goofy dead connection, I can wave my arms and tell customers "it's a cost of extra security"... except I need a way to identify the goofy dead connection apart from a real user error.
In particular, the user now sees this banner message:
Duplicate Foxhound sampling sessions. There is more than one Foxhound connection to this target database.
I'd rather not have to, but... as they say, "any and all suggestions are welcome" 🙂
This is not an answer to the question, but it does suggest a workaround...
The goofy connection to the target database is well and truly idle, and that's how it can be identified...
IF DATEDIFF ( MILLISECOND, LoginTime, LastReqTime ) <= 1000 THEN 'Goofy!'
Here is a query of the Foxhound database when the following conditions are in effect:
There are two Foxhound sampling sessions (7 and 😎 connected to the same target database ddd17.db, one via DSN and the other via DSN-less connection string.
Each sampling session "sees" three connections on the target database: It's own real connection to the target database, the other session's real connection to the target database, and the goofy connection.
That means Foxhound is recording six sets of data; i.e., 3 connections times 2 sessions.
Here's a snapshot...
Session Target Conn # Conn Name current_req_status msec What am I? ------- ------------ ------ ---------------------- ------------------- ------- ---------- 7 ddd17 1 Foxhound-Monitor-19744 Executing 3503587 Real! 7 ddd17 2 Foxhound-Monitor-19744 Idle 3503619 Real! 7 ddd17 23 Foxhound-Monitor-19744 Idle 7 Goofy! 8 ddd17 string 1 Foxhound-Monitor-19744 Waiting for thread 3503571 Real! 8 ddd17 string 2 Foxhound-Monitor-19744 Executing 3503603 Real! 8 ddd17 string 23 Foxhound-Monitor-19744 Idle 7 Goofy!
In this case, there is a legitimate reason to display the "Duplicate Foxhound sampling sessions" message (two sessions for the same physical database is a waste of resources)...
...but it's NOT because of the goofy connection.
Yay!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.