Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

fix(process): refactor away the bugs and race conditions in proc_t

Open FrogTheFrog opened this issue 11 months ago • 3 comments

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


1

2

3

4_1 4_2 4_3 4_4

5

6

7

8

9

10

11

12

13

14

15

16_1 16_2

17

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

FrogTheFrog avatar Jan 29 '25 14:01 FrogTheFrog

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.

Files with missing lines Patch % Lines
src/process.cpp 1.57% 130 Missing and 57 partials :warning:
src/nvhttp.cpp 0.00% 0 Missing and 7 partials :warning:
src/confighttp.cpp 0.00% 0 Missing and 2 partials :warning:
src/stream.cpp 0.00% 0 Missing and 2 partials :warning:
src/process.h 0.00% 0 Missing and 1 partial :warning:
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:

... and 1 file with indirect coverage changes

codecov[bot] avatar Jan 29 '25 14:01 codecov[bot]

Quality Gate Failed 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

sonarqubecloud[bot] avatar Feb 18 '25 15:02 sonarqubecloud[bot]

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!

LizardByte-bot avatar May 20 '25 10:05 LizardByte-bot

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!

LizardByte-bot avatar Aug 20 '25 10:08 LizardByte-bot

This PR was closed because it has been stalled for 10 days with no activity.

LizardByte-bot avatar Aug 31 '25 10:08 LizardByte-bot