You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "DaanHoogland (via GitHub)" <gi...@apache.org> on 2026/10/01 11:46:25 UTC

[PR] NetworkGarbageCollector can tear down a network with a live Running VR [cloudstack]

DaanHoogland opened a new pull request, #14281:
URL: https://github.com/apache/cloudstack/pull/14281

   countNicsForNonStoppedRunningVrs() in NicDaoImpl checked VR state Starting/Stopping/Migrating but omitted Running, so a router that resynced back to Running after a spurious PowerReportMissing was never counted, letting isNetworkReadyForGc() approve garbage collection of a network with a live NIC/VR.
   
   Added VirtualMachine.State.Running to the state filter and a test, NicDaoImplTest#testCountNicsForNonStoppedRunningVrsIncludesRunningState, which fails without the fix (asserts the join's state parameters include Running).
   
   Generated-by: Claude Code (claude-sonnet-5)
   
   ### Description
   
   This PR...
   <!--- 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: #14177
   
   <!--- ******************************************************************************* -->
   <!--- NOTE: AUTOMATION 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)
   - [ ] 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)
   - [ ] Build/CI
   - [ ] Test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] 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 -->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/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.

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

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


Re: [PR] NetworkGarbageCollector can tear down a network with a live Running VR [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #14281:
URL: https://github.com/apache/cloudstack/pull/14281#issuecomment-5930755855

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/14281?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 4.02%. Comparing base ([`250695e`](https://app.codecov.io/gh/apache/cloudstack/commit/250695ec331328e9fec08a5422d27e91fd4cdf87?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`0f2d389`](https://app.codecov.io/gh/apache/cloudstack/commit/0f2d389f374052f4318f1fbe973762c6ba325d51?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 3 commits behind head on 4.22.
   > :exclamation:  There is a different number of reports uploaded between BASE (250695e) and HEAD (0f2d389). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (250695e) | HEAD (0f2d389) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               4.22   #14281       +/-   ##
   =============================================
   - Coverage     18.00%    4.02%   -13.99%     
   =============================================
     Files          5936      449     -5487     
     Lines        535716    38239   -497477     
     Branches      65596     7082    -58514     
   =============================================
   - Hits          96457     1538    -94919     
   + Misses       428269    36489   -391780     
   + Partials      10990      212    -10778     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/14281/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/14281/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.02% <ø> (ø)` | |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/14281/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/cloudstack/pull/14281?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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


Re: [PR] NetworkGarbageCollector can tear down a network with a live Running VR [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #14281:
URL: https://github.com/apache/cloudstack/pull/14281#issuecomment-6288590194

   @DaanHoogland 
   as we discussed offline, it is expected that `NetworkGarbageCollector can tear down a network with a live Running VR`


-- 
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


Re: [PR] NetworkGarbageCollector can tear down a network with a live Running VR [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #14281:
URL: https://github.com/apache/cloudstack/pull/14281#issuecomment-6315035060

   > > @DaanHoogland as we discussed offline, it is expected that `NetworkGarbageCollector can tear down a network with a live Running VR`
   > 
   > remind me of the full discussion @weizhouapache; Do we need to teardown the VR first? Should I continue with this line of fixing the issue or abandon the PR?
   > 
   
   the NetworkGarbageCollector will shutdown the network if there is no USER vms running after a period.
   as part of the network shutdown, the running VR will be stopped.
   hence, there is no issue if the VR is Running
   
   > As I understand the edge case here is that a VR is running while no VMs are and we need to tear down the network it services. This is not exactly what @Pearl1594 describes in #14177 so we still need to look for the gaps. From her proposed solutions, what is missing here is:
   > 
   > * On VM power-state resync to Running after a missing-VM event, reconcile the NIC (broadcast_uri/isolation_uri/state=Reserved) and restore nics_count.
   
   this makese sense.
   
   > * Include the VirtualRouter's own NIC in nics_count from network creation
   
   this does not make sense.
   
   > 
   > agree?
   
   


-- 
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


Re: [PR] NetworkGarbageCollector can tear down a network with a live Running VR [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #14281:
URL: https://github.com/apache/cloudstack/pull/14281#issuecomment-6313827702

   > @DaanHoogland as we discussed offline, it is expected that `NetworkGarbageCollector can tear down a network with a live Running VR`
   
   remind me of the full discussion @weizhouapache; Do we need to teardown the VR first? Should I continue with this line of fixing the issue or abandon the PR?
   
   As I understand the edge case here is that a VR is running while no VMs are and we need to tear down the network it services. This is not exactly what @Pearl1594 describes in #14177 so we still need to look for the gaps.
   From her proposed solutions, what is missing here is:
   - On VM power-state resync to Running after a missing-VM event, reconcile the NIC (broadcast_uri/isolation_uri/state=Reserved) and restore nics_count.
   - Include the VirtualRouter's own NIC in nics_count from network creation
   
   agree?


-- 
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