Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Active sessions problem
#12
Hi Alex,
I disabled my timeout logic in my code and I used the "keepalive=true" and I still got the stuck sessions. I do not terminate sessions by hand anywhere in my application in normal usage, the code that I posted in my previous post was just to test if I can kill the sessions that have activeform=nil, but I can't. 

So, like I said in my original post, at night, when the traffic is low, I find sometimes thousands of active sessions and some of them have the activeform=nil. How do they appear, I have no idea. I posted in my original post a pastebin with a list of the active sessions when this problem appeared, here it is again:
https://pastebin.com/raw/x0YASKBS
In that list, all the sessions that show ActiveForm=undef have the ActiveForm=nil.
Also, there are multiple duplicate sessions that have an ActiveForm but 100% they shouldn't be active.

I know how much traffic is on the server, so to me it appears that sometimes, when the server has no or low activity, all the sessions that were terminated by the server logic (user closes the browser for example) are revived. Of course this is a guess, but considering that the application doesn't have more than - let's say - 30-40 simultaneously sessions at peak times, it would take a lot of time to collect over 3000 sessions. Again, to make myself as clear as I can, most of the time the server appears to work properly and if I list the active sessions I see 30-40 at peak times, but then, at random - usually when the server should have no activity, when I check the active sessions I see hundreds or thousands and many of them have the ActiveForm=nil and they are never terminated by the server (those users aren't online at 3AM) and I can't terminate them either with the code from my previous post. The only way to fix this is to restart the application and then it will work fine again for a while until it doesn't.

As a side note, because I'm not sure if this is related: 
Playing with the code bellow, trying to kill sessions manually (again, this code is nowhere used in the application that mentioned above) I see that if I start a session to the server (opening a form in the browser), the following code will kill the session right away while the browser is still open, but it will not kill the session when the browser is already closed and the session will timeout by itself


Code:
    xList := GSessions.LockList(False);
    try
      for i := 0 to xList.Count - 1 do
      begin
        App := TIWApplication(xList[i]);
        App.Terminate;
      end;
    finally
      GSessions.UnLockList(xList);
    end;
Reply


Messages In This Thread
Active sessions problem - by ioan - 06-12-2019, 07:06 PM
RE: Active sessions problem - by kudzu - 06-12-2019, 09:53 PM
RE: Active sessions problem - by ioan - 06-13-2019, 01:25 PM
RE: Active sessions problem - by kudzu - 06-13-2019, 03:18 PM
RE: Active sessions problem - by DanBarclay - 06-13-2019, 08:38 PM
RE: Active sessions problem - by DanBarclay - 06-14-2019, 06:06 AM
RE: Active sessions problem - by ioan - 06-20-2019, 06:05 AM
RE: Active sessions problem - by ioan - 06-20-2019, 06:31 PM
RE: Active sessions problem - by ioan - 06-26-2019, 07:47 AM
RE: Active sessions problem - by ioan - 06-26-2019, 06:38 PM
RE: Active sessions problem - by ioan - 06-27-2019, 07:27 AM
RE: Active sessions problem - by ioan - 06-27-2019, 10:40 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)