Pruning Abandoned Sessions

The link works great, but I was wondering if there was a way to automate it. Especially for Panel Edition installs that may lose power… hypothetically speaking… not that it ever happens around here… :mrgreen:

Tiny little bump…

OT: Have a great Memorial Day weekend with lots of time spent with family and friends and cooking things with fire… :mrgreen:

I’ve been playing with programming some modules, and I tried to do this using the Ignition Java API.

I was able to find the sessions, and figure out which ones were stale. However, I didn’t find anything in the API that allows me to terminate a session using Java.

In case I just missed something, here is the relevant code block.

for (ClientReqSession session : context.getGatewaySessionManager().findSessions()) { long timeSinceLastAccess = ((System.currentTimeMillis()-session.getLastAccessedTime())/1000);"Session last accessed "+timeSinceLastAccess+" seconds ago."); if (timeSinceLastAccess > 10) { // Kill the session } }

If there is a way to do a session.kill(), I’d be happy to throw that in and package this up as a module.

Thanks for taking a look at it, Kevin.

I’ve had zero time for API/module development myself. I hate it when work gets in the way of the fun stuff… :laughing:

It looks like my sessions actually have a Timeout value, that when it reaches that value, the session is automatically pruned.


(Running 7.2.6)

Well, yes. But, if we are only allowed 1 client session in panel edition and the client session isn’t flushed on startup from a power outage/flicker/flatulence, then I don’t really want to wait 10 minutes for it to automagically purge. I also have other machines that have to get back up and running, so I may not have time to manually purge them.

I haven’t (yet) found where the timeout setpoints are kept, but if I can get it down a lot lower, then I can get my timing in in better shape to recover.

On the flip side, I’ve noticed with panel edition that if it has an abandoned session, you can start a new one, and it works, but the autologon feature does not. Perhaps if that portion were looked at by IA, then the 10 minute limit may not be so bad.

Hey IA guys, is there any way to kill a session using the Module SDK? (See code earlier in the thread…)

Probably, but we generally don’t respond to general improvement requests with “write a module to code around it”. (Hint: see GatewaySessionManager in the Gateway API)

Like Kevin said, client sessions are automatically pruned via the “timeout” mechanism. I think the real problem is that 10 minutes is way too long of a timeout, especially given than any live client will always ping the gateway every 2 seconds to make sure it’s still “connected”.

Maybe changing the timeout to 1 minute would be an effective fix.

Still haven’t found out where this is set, but then, I’ve been off onto the the next crisis de jour.

Is that floating somewhere in the ignition.conf file?

EDIT: OK, maybe that wasn’t the right question to ask. I guess I’m asking “Is this something that’s user-configurable?”.

Sorry, still tired from Father’s Day. Who said this was supposed to be a relaxing day?!?

Yeah, sorry to lead you on like that. This is a change we’d have to make in the software. Actually, I did end up making this change for 7.2.7.

Ah. :open_mouth: That would explain why I couldn’t find anything.

I’ll wait patiently.

Thanks, Carl. Your hero status has been restored.