Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The callback of stop previous VPN session may happen after new session started when starting a new vpn session #706

Open
enuoCM opened this issue Jun 26, 2017 · 0 comments

Comments

@enuoCM
Copy link

enuoCM commented Jun 26, 2017

Test on latest commit d634606.
I added some log messages in OpenVPNService#stopOldOpenVPNProcess(), OpenVPNService#forceStopOpenVpnProcess, OpenVPNService#processDied() and OpenVPNService#unregisterDeviceStateReceiver().
Sometimes I got following log:

06-26 11:24:19.052 D/test   (25945): stopOldOpenVPNProcess mManagement: com.cloudminds.security.mimclient.openvpn.core.OpenVpnManagementThread@eb820af
06-26 11:24:20.083 D/test   (25945): forceStopOpenVpnProcess: interrupt the old mProcessThread: Thread[MIMOpenVPNProcessThread,5,main]
06-26 11:24:21.084 D/test   (25945): a new mProcessThread created for the new vpn session, mProcessThread: Thread[MIMOpenVPNProcessThread,5,main]
06-26 11:24:21.085 D/test   (25945): unregisterDeviceStateReceiver!!! (happend in startOpenVPN# new Handler(getMainLooper()).post)
06-26 11:24:21.086 D/test   (25945): registerDeviceStateReceiver: mDeviceStateReceiver:com.cloudminds.security.mimclient.openvpn.core.DeviceStateReceiver@3ca6c79a (happend in startOpenVPN# new Handler(getMainLooper()).post)
06-26 11:24:21.157 D/test   (25945): processDied: mDeviceStateReceiver:com.cloudminds.security.mimclient.openvpn.core.DeviceStateReceiver@3ca6c79a
06-26 11:24:21.158 D/test   (25945): unregisterDeviceStateReceiver!!! (happend in processDied()->endVpnService())

You can find that the new regiestered DeviceStateReceiver@3ca6c79a was removed incorrectly. In fact more incorrect actions were done in processDied() under this case. I think here is a synchronizion issue.

@enuoCM enuoCM changed the title The callback of stop previous VPN session may happent after new session started when starting a new vpn session The callback of stop previous VPN session may happen after new session started when starting a new vpn session Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant