VPNStatus icon indicating copy to clipboard operation
VPNStatus copied to clipboard

VPN drops and the app doesn't reconnect for a while

Open rtrad89 opened this issue 2 years ago • 9 comments

Thank you for the great work.

I have a MS Azure VPN which keeps dropping. I've tried this app and it seems it works occasionally.

  • At times, the VPN drops and I get reconnected within seconds, so all my open sessions are maintained.
  • However, sometimes the VPN drops and the app does not auto-reconnect me for minutes, which makes the open DB / RDP sessions disconnect. I can manually reconnect with no issues.

I am not sure why sometimes the app reconnects the VPN almost immediately but sometimes it takes it minutes to do so.

rtrad89 avatar Jan 22 '24 10:01 rtrad89

Thanks for using VPNStatus!

By default VPNStatus tries to reconnect every 120s. If your VPN drops and you are lucky, VPNStatus might reconnect right away or wait up to 120s.

I recommend reducing the delay in your case to prevent session disconnection. You can achieve this by setting the retry delay to 12 seconds using the following command line in your Terminal:

defaults write org.timac.VPNStatus AlwaysConnectedRetryDelay -int 12

Let me know if that helps! See the following link for more info: https://github.com/Timac/VPNStatus#retry-delay

Timac avatar Jan 25 '24 07:01 Timac

Hello Timac,

I have done what you said and it looks much better.

I will give you word after more thorough testing, but perhaps this can be an explicit configuration in the app instead of a secret argument?

I will get back to you anyway, and thank you again.

rtrad89 avatar Jan 25 '24 10:01 rtrad89

Great to hear!

This setting is a secret preference because… I haven't found the time to build the UI 😅

Timac avatar Jan 25 '24 19:01 Timac

Good evening @Timac While the situation has improved for virtual machines' RDP sessions, DB server connections (via, say, pgAdmin) were too demanding, and even with 12 seconds delay I'd lose my transaction and connection.

So I would say the app improved the situation for VM sessions, but not for DB server connections.

rtrad89 avatar Feb 08 '24 16:02 rtrad89

Good evening @Timac While the situation has improved for virtual machines' RDP sessions, DB server connections (via, say, pgAdmin) were too demanding, and even with 12 seconds delay I'd lose my transaction and connection.

So I would say the app improved the situation for VM sessions, but not for DB server connections.

Do you know what the database connection timeout is in your case?

Timac avatar Feb 08 '24 16:02 Timac

Update: I use Postgres and pgAdmin. I have changed the connection timeout setting within pgAdmin from 10 seconds to 120 seconds, but I would still lose the connection between VPN drops.

On the server, there is no timeout less than 12; actually, idle session timeout and idle in transaction session timeout are both disabled.

I will use it a bit more and see.

rtrad89 avatar Mar 06 '24 12:03 rtrad89

May I ask why can't the retry delay be set to less than 12 seconds? On average, it kicks in after 8 seconds, but that is enough to disrupt the connection unfortunately.

rtrad89 avatar Mar 07 '24 11:03 rtrad89

May I ask why can't the retry delay be set to less than 12 seconds? On average, it kicks in after 8 seconds, but that is enough to disrupt the connection unfortunately.

I wanted to avoid some possible race conditions where a retry would happen while retrying. It might be possible to remove this limitation.

Timac avatar Mar 08 '24 07:03 Timac

May I ask why can't the retry delay be set to less than 12 seconds? On average, it kicks in after 8 seconds, but that is enough to disrupt the connection unfortunately.

I wanted to avoid some possible race conditions where a retry would happen while retrying. It might be possible to remove this limitation.

As it stands, I am still losing connections / transactions, so 12 seconds is a bit too long for my use-case.

I think if this parameter is visible, and this limitation is removed, using a retry delay of less than, say, 5 seconds, should help considerably.

rtrad89 avatar Apr 04 '24 09:04 rtrad89

I will try to find time in the coming days to add a preferences window where you can configure these settings

Timac avatar Apr 06 '24 16:04 Timac

@rtrad89 The 12s limitation has been removed and the value can be set in the preferences window in VPNStatus 3.0: https://github.com/Timac/VPNStatus/releases

Timac avatar Apr 13 '24 16:04 Timac