You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/02/01 11:08:33 UTC

[GitHub] [cloudstack] ravening opened a new pull request #4635: Persist vpn connection state before restarting

ravening opened a new pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635


   ### 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
   
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ********************************************************************************* -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ********************************************************************************* -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [X] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [X] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   <!-- see how your change affects other areas of the code, etc. -->
   
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document -->
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez merged pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
nvazquez merged pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-920324783


   <b>Trillian test result (tid-2057)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 40785 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4635-t2057-kvm-centos7.zip
   Smoke tests completed. 88 look OK, 1 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   ContextSuite context=TestKubernetesCluster>:teardown | `Error` | 78.82 | test_kubernetes_clusters.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti closed pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
sureshanaparti closed pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-770785645


   @ravening did you try this while state == pending or while state == disconnected? it seems a bit brute force to me.
   Also #4429 is on 4.14, would you rather point this to 4.14 as well?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] ravening commented on a change in pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
ravening commented on a change in pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#discussion_r704178957



##########
File path: server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
##########
@@ -561,12 +561,12 @@ public Site2SiteVpnConnection resetVpnConnection(ResetVpnConnectionCmd cmd) thro
         }
         _accountMgr.checkAccess(caller, null, false, conn);
 
-        if (conn.getState() == State.Pending) {
-            conn.setState(State.Disconnected);
-        }
-        if (conn.getState() == State.Connected || conn.getState() == State.Error || conn.getState() == State.Disconnected) {
-            stopVpnConnection(id);
-        }
+        // Set vpn state to disconnected
+        conn.setState(State.Disconnected);
+        _vpnConnectionDao.persist(conn);

Review 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




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-770790490


   > > @ravening did you try this while state == pending or while state == disconnected? it seems a bit brute force to me.
   > > Also #4429 is on 4.14, would you rather point this to 4.14 as well?
   > 
   > @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?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-918846031


   @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-919711804


   @blueorangutan package 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-919712065


   @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-912177657


   Ping @ravening can you address the open comments and fix conflicts? Thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] ravening commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-770786852


   > @ravening did you try this while state == pending or while state == disconnected? it seems a bit brute force to me.
   > 
   > Also #4429 is on 4.14, would you rather point this to 4.14 as well?
   
   @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


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-919030519


   Packaging result: :heavy_multiplication_x: el7 :heavy_check_mark: el8 :heavy_multiplication_x: debian :heavy_check_mark: suse15. SL-JID 1235


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-919743941


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1257


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] ravening commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-770883170


   > > > @ravening did you try this while state == pending or while state == disconnected? it seems a bit brute force to me.
   > > > Also #4429 is on 4.14, would you rather point this to 4.14 as well?
   > > 
   > > 
   > > @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


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] ravening commented on a change in pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
ravening commented on a change in pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#discussion_r691011365



##########
File path: server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
##########
@@ -561,12 +561,12 @@ public Site2SiteVpnConnection resetVpnConnection(ResetVpnConnectionCmd cmd) thro
         }
         _accountMgr.checkAccess(caller, null, false, conn);
 
-        if (conn.getState() == State.Pending) {
-            conn.setState(State.Disconnected);
-        }
-        if (conn.getState() == State.Connected || conn.getState() == State.Error || conn.getState() == State.Disconnected) {
-            stopVpnConnection(id);
-        }
+        // Set vpn state to disconnected
+        conn.setState(State.Disconnected);
+        _vpnConnectionDao.persist(conn);
+
+        // Stop and start the connection again
+        stopVpnConnection(id);

Review comment:
       @rhtyd probably no as this involves updating the state in db




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] ravening commented on a change in pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
ravening commented on a change in pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#discussion_r691011365



##########
File path: server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
##########
@@ -561,12 +561,12 @@ public Site2SiteVpnConnection resetVpnConnection(ResetVpnConnectionCmd cmd) thro
         }
         _accountMgr.checkAccess(caller, null, false, conn);
 
-        if (conn.getState() == State.Pending) {
-            conn.setState(State.Disconnected);
-        }
-        if (conn.getState() == State.Connected || conn.getState() == State.Error || conn.getState() == State.Disconnected) {
-            stopVpnConnection(id);
-        }
+        // Set vpn state to disconnected
+        conn.setState(State.Disconnected);
+        _vpnConnectionDao.persist(conn);
+
+        // Stop and start the connection again
+        stopVpnConnection(id);

Review comment:
       @rhtyd probably no as this involves updating the state in db




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-918845869


   @blueorangutan package 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-919762082


   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] weizhouapache commented on a change in pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on a change in pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#discussion_r691176930



##########
File path: server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
##########
@@ -561,12 +561,12 @@ public Site2SiteVpnConnection resetVpnConnection(ResetVpnConnectionCmd cmd) thro
         }
         _accountMgr.checkAccess(caller, null, false, conn);
 
-        if (conn.getState() == State.Pending) {
-            conn.setState(State.Disconnected);
-        }
-        if (conn.getState() == State.Connected || conn.getState() == State.Error || conn.getState() == State.Disconnected) {
-            stopVpnConnection(id);
-        }
+        // Set vpn state to disconnected
+        conn.setState(State.Disconnected);
+        _vpnConnectionDao.persist(conn);

Review comment:
       why not just persist DB only when state is pending ?
   
   ```
           if (conn.getState() == State.Pending) {
               conn.setState(State.Disconnected);
               _vpnConnectionDao.persist(conn);
           }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] ravening commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-915038553


   > Ping @ravening
   
   @rhtyd done


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#issuecomment-914909496


   Ping @ravening 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] weizhouapache commented on a change in pull request #4635: Persist vpn connection state before restarting

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on a change in pull request #4635:
URL: https://github.com/apache/cloudstack/pull/4635#discussion_r691176930



##########
File path: server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
##########
@@ -561,12 +561,12 @@ public Site2SiteVpnConnection resetVpnConnection(ResetVpnConnectionCmd cmd) thro
         }
         _accountMgr.checkAccess(caller, null, false, conn);
 
-        if (conn.getState() == State.Pending) {
-            conn.setState(State.Disconnected);
-        }
-        if (conn.getState() == State.Connected || conn.getState() == State.Error || conn.getState() == State.Disconnected) {
-            stopVpnConnection(id);
-        }
+        // Set vpn state to disconnected
+        conn.setState(State.Disconnected);
+        _vpnConnectionDao.persist(conn);

Review comment:
       why not just persist DB only when state is pending ?
   
   ```
           if (conn.getState() == State.Pending) {
               conn.setState(State.Disconnected);
               _vpnConnectionDao.persist(conn);
           }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org