Replies: 11 comments 3 replies
-
Hi Jason, The session might also expire if the connection to the server is closed or lost. However, you don't need to set an excessively large Glacier2 session timeout. The ACM heartbeats should keep the session alive under normal circumstances. I recommend setting both the client ACM timeout and the Glacier2 session timeout to the same value, such as 60 seconds. Additionally, it would be useful to enable protocol, and network tracing by setting |
Beta Was this translation helpful? Give feedback.
-
Hi Jose Thanks for getting back to me so quickly. At the moment, the only reason for the long session timeout is because the heartbeats don't seem to be doing their job. So, for now, it allows me to carry on developing and testing my code. I have set the network and protocol traces to the values you suggested and attached the log files. I also changed the session timeout to 300 so it would fail more quickly. console_output.txt is from the client running on the web browser console Everything is running on the same host so the timestamps will be synchronised almost perfectly. As you can see, there are heartbeat messages being sent every 30 seconds and received by Glacier and then after 5 minutes, Glacier closes the session. Any help would be appreciated and if you need anything else then please let me know. Jason |
Beta Was this translation helpful? Give feedback.
-
Glacier2 attempts to contact the session object each time it receives a heartbeat by sending a ping message. In the Glacier2 logs, it shows that this call is failing with “object not exists”. As a result of this failure, the session is being destroyed.
This suggests there is an issue with the session manager, the object is not longer alive, the fact that you get "object not exists" suggest that it was unregistered. It would be easier to pinpoint the issue if you could provide some sample code for your session manager. |
Beta Was this translation helpful? Give feedback.
-
Hi Jason Can you try enabling ACM in your Glacier2 configuration by setting:
IceGrid reaps sessions that doesn't get any heartbeats in the configured session timeout. The ping messages send by Glacier2 are not having the desired effect of keeping the session alive. It seems this could be a bug in the IceGrid session manager. Sending a ping (or any other message) should be enough to keep the session alive. Enabling ACM on Glacier2 router should allow you to workaround the issue. |
Beta Was this translation helpful? Give feedback.
-
Hi Jose I've added that and it still closes rhe connection after 5 minutes. I also enabled IceGrid logging to a file and enabled session tracing and I can see the messages being sent every 15 seconds. The log files are attached including the new IceGrid Registry/Node log file. I then called the ice_ping() function on my server proxy from the client (through Glacier) at about 4 minutes and it didn't delay the connection closure. chrome-console.txt |
Beta Was this translation helpful? Give feedback.
-
Hi Jason are you using There is a bug in the code that handle IceGrid Glacier2 sessions that is causing the session to be destroyed even if Glacier2 periodically pings the sessions. |
Beta Was this translation helpful? Give feedback.
-
Hi Jose I am using it on purpose - at least I think I am.. The structure of my application is as follows: I have a farm of servers on a private network with one public server having two network interfaces - one for the private network and one for the Internet. The public server runs a web server and Glacier (which span the two networks) and IceGrid (which is only accessible on the private network). So, Glacier is used because the C++ apps run on a private network, and IceGrid is used to start these apps on the least loaded server on an as-needed basis. I use the "on-demand" feature of Icegrid to start the apps but never use IceGrid to stop idle apps - I do that by calling my own quit() function from the web server via the C++ apps Ice proxies when the web login session expires. I hope that makes sense. Please let me know if not. I have started creating a simple project (a C++ server and client, and config files for Glacier and Icegrid) that will, hopefully, give the same behaviour but be small enough to zip up and attach. Would that be useful to test for the bug you mentioned? Or is the issue already known and being investigated? Thanks for all your help so far, Jason |
Beta Was this translation helpful? Give feedback.
-
Hi Jason, We were able to reproduce the issue with a setup that mimics your configuration, thanks for the details. I have opened a PR with a fix for the 3.7 branch, see #2756 It is not clear to me that you need to use IceGrid/SessionManager, if you are not using any of the operations defined in Line 26 in 290d529 |
Beta Was this translation helpful? Give feedback.
-
Hi Jose I tried removing the And I think I need this because the proxies returned from IceGrid when it starts a new server need the Locator. But, again, I could be wrong. I think I'll wait for a binary to become available - I'll just increase the SessionTimeout back up to a large value in the meantime. Thanks for all your help with this. Jason |
Beta Was this translation helpful? Give feedback.
-
I simply get a null session.. I have attached my latest config and logs as usual. The client code is:
You can see in the chrome-console.txt - the final console.log prints null. I have also attached a snapshot of the Connection object in Chrome. chrome-console.txt |
Beta Was this translation helpful? Give feedback.
-
Wow.. You are a star!! |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a web site client communicating via Glacier to a C++ server (all using Ice 3.7.9). On the client I have ACM enabled with a timeout of 60 seconds and I have set a Glacier session timeout of 1 hour. I can see in the Chrome console and the Glacier logs that a heartbeat message is sent every 30 seconds - as expected.
However, if I don't interact with the server (i.e. call any methods on the server) the session still expires after the 1 hour. I thought if Glacier received heartbeats it would stop the session expiring.
What have I done wrong?
Thanks,
Jason
Beta Was this translation helpful? Give feedback.
All reactions