Timac / VPNStatus

VPNStatus, a replacement for macOS builtin VPN Status
https://blog.timac.org/2018/0719-vpnstatus/
MIT License
221 stars 31 forks source link

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

Closed rtrad89 closed 4 months ago

rtrad89 commented 7 months ago

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.

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

Timac commented 7 months ago

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

rtrad89 commented 7 months ago

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.

Timac commented 7 months ago

Great to hear!

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

rtrad89 commented 6 months ago

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.

Timac commented 6 months ago

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?

rtrad89 commented 5 months ago

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 commented 5 months ago

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.

Timac commented 5 months ago

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.

rtrad89 commented 4 months ago

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.

Timac commented 4 months ago

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

Timac commented 4 months ago

@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