fix(process): refactor away the bugs and race conditions in proc_t
Description
This is a continuation of https://github.com/LizardByte/Sunshine/pull/3417.
Moved the code around to remove possible race conditions and bad patterns in general. I tried to not change the logic at all if possible, therefore while some of the sonarqube suggestions are valid, will not be addressed.
Screenshot
Since I have moved stuff around to be in the same order as a header, the diff can be hard to read. These are the screenshots I used for checking for changes (for the "refactoring" commit only):
Issues Fixed or Closed
Resolves this PR: https://github.com/LizardByte/Sunshine/pull/3417
Type of Change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Dependency update (updates to dependencies)
- [ ] Documentation update (changes to documentation)
- [ ] Repository update (changes to repository files, e.g.
.github/...)
Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated the in code docstring/documentation-blocks for new or existing methods/components
Codecov Report
:x: Patch coverage is 1.48515% with 199 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 11.57%. Comparing base (fa22227) to head (65a54ad).
:warning: Report is 305 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #3604 +/- ##
==========================================
- Coverage 11.61% 11.57% -0.04%
==========================================
Files 92 92
Lines 17337 17363 +26
Branches 8100 8123 +23
==========================================
- Hits 2013 2010 -3
- Misses 12833 12840 +7
- Partials 2491 2513 +22
| Flag | Coverage Δ | |
|---|---|---|
| Linux | 11.24% <1.53%> (-0.05%) |
:arrow_down: |
| Windows | 12.97% <0.00%> (-0.05%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| src/process.h | 0.00% <0.00%> (-12.50%) |
:arrow_down: |
| src/confighttp.cpp | 0.00% <0.00%> (ø) |
|
| src/stream.cpp | 2.51% <0.00%> (ø) |
|
| src/nvhttp.cpp | 18.62% <0.00%> (+0.08%) |
:arrow_up: |
| src/process.cpp | 0.74% <1.57%> (-0.35%) |
:arrow_down: |
Quality Gate failed
Failed conditions
9 New issues
9 New Code Smells (required ≤ 0)
See analysis details on SonarQube Cloud
Catch issues before they fail your Quality Gate with our IDE extension
SonarQube for IDE
It looks like this PR has been idle for 90 days. If it's still something you're working on or would like to pursue, please leave a comment or update your branch. Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks!
It looks like this PR has been idle for 90 days. If it's still something you're working on or would like to pursue, please leave a comment or update your branch. Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks!
This PR was closed because it has been stalled for 10 days with no activity.