Closed WikkidEdd closed 2 years ago
Hi Edd! We will revisit the callback behavior and fix inconsistencies if we find them. So thanks for additional context, that is pretty helpful! Florian
Hi @WikkidEdd , We have looked into point 3 and there is indeed a case where ARRServiceUnity.OnSessionStatusChanged was not called but the session status was changed. This is the case if you call ARRServiceUnity.ForgetSession. A fix will go out with the next release.
In general, if you stop a session, you will inevitably end up with ConnectionLost and ARRServiceUnity.OnSessionStatusChanged eventually. The order can be a bit random as the session status is polled at regular intervals and shutting down a VM is not an atomic operation. As you already mentioned, calling ARRServiceUnity.StopSession will remove the active session in Unity and so you might miss the ConnectionStatusChanged as you no longer track an active session to begin with.
Besides this, you can hit "ConnectionLost" due to network connectivity issues which would obviously not trigger the OnSessionStatusChanged callback as the session wasn't touched (it's still in Ready state), we merely lost connection to it intermittently and a reconnect will solve the problem.
Cheers, Christopher
Thanks for the extra detail. That has helped me get a better picture in my head of what is going on.
What happens if the session status can't be polled due to connectivity. Will it just hold on to the last known session status or will it eventually change status to Unknown or Error?
Hi @WikkidEdd, sorry for the late reply. It will remain at the last known state until a get session properties call succeeds or you explicitly call ForgetSession / StopSession. Note that if you have connectivity issues StopSession will most likely fail, and the state will continue to remain unchanged.
Hi @WikkidEdd , we have fixed the callback inconsistency in release 1.0.57 and ARRServiceUnity.ForgetSession will now trigger ARRServiceUnity.OnSessionStatusChanged as it does change the status to unknown.
We've been looking into making our unexpected disconnection handling more robust (i.e internet connection drop or server unexpectedly shutting down). To reproduce this type of scenario we've been stopping the ARR server while the client is connected via the REST API and we're seeing inconsistent behaviour of the StatusChanged callbacks.
We see 3 different behaviours with no real pattern:
I can see that 1 and 2 might occurs in a multi-threaded scenario, but 3 seems like it should never happen.
We should be able to put some workarounds for this behaviour, but thought you should know about this behaviour.