Persist vpn connection state before restarting#4635
Conversation
@DaanHoogland this was when state is pending. We need to persist state in DB so that the connection is restarted. If we don't persist then check fails and connection is not restarted The other pr is already in 4.16. so this can go-to 4.16 as well |
the other pr is also in 4.14, so if this only goes into 4.16 do we then have half a fix in the LTS versions? |
good point. i will raise for 4.14 as well |
| _vpnConnectionDao.persist(conn); | ||
|
|
||
| // Stop and start the connection again | ||
| stopVpnConnection(id); |
There was a problem hiding this comment.
Would without checking for the current conn state cause any issue @ravening ? For example, try to stop vpn connection when VR has errors is powered off etc or in other transitional state?
There was a problem hiding this comment.
@rhtyd probably no as this involves updating the state in db
| } | ||
| // Set vpn state to disconnected | ||
| conn.setState(State.Disconnected); | ||
| _vpnConnectionDao.persist(conn); |
There was a problem hiding this comment.
why not just persist DB only when state is pending ?
if (conn.getState() == State.Pending) {
conn.setState(State.Disconnected);
_vpnConnectionDao.persist(conn);
}
There was a problem hiding this comment.
@weizhouapache since we are restting the connection, it should transit to disconnect state irrecpective of the previous state. since we are stopping and starting the vpn connection, checking for pending state or any other state doesnt matter
|
Ping @ravening can you address the open comments and fix conflicts? Thanks |
|
Ping @ravening |
If the vpn connection is in pending state then we cant restart the vpn connection. So manually set the state to disconnected and then try to restart the vpn connection
2f69fd0 to
085dbdb
Compare
@rhtyd done |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖️ el7 ✔️ el8 ✖️ debian ✔️ suse15. SL-JID 1235 |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1257 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2057)
|
Description
If the vpn connection is in pending state then we cant restart the
vpn connection. So manually set the state to disconnected and then
try to restart the vpn connection
This pr is needed along with https://github.com/apache/cloudstack/pull/4429/files
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?