Skip to content

Conversation

@patrick96
Copy link
Member

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

Description

Since the forked processes are still our children, we need to wait on
them, otherwise they become zombie processes.

We now fork twice, let the first fork immediately return and wait on it.
This reparents the second fork, which runs the actual code, to the init
process which then collects it.

Related Issues & Documents

Ref #770

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

Since the forked processes are still our children, we need to wait on
them, otherwise they become zombie processes.

We now fork twice, let the first fork immediately return and wait on it.
This reparents the second fork, which runs the actual code, to the init
process which then collects it.

Ref polybar#770
@patrick96 patrick96 force-pushed the fix/zombie-processes branch from 87aba9e to 89dc4b5 Compare December 12, 2020 01:32
@codecov
Copy link

codecov bot commented Dec 12, 2020

Codecov Report

Merging #2285 (89dc4b5) into hotfix/3.5.1 (ccf14d9) will decrease coverage by 0.01%.
The diff coverage is 28.12%.

Impacted file tree graph

@@               Coverage Diff               @@
##           hotfix/3.5.1   #2285      +/-   ##
===============================================
- Coverage          7.22%   7.21%   -0.02%     
===============================================
  Files               156     156              
  Lines             10707   10730      +23     
===============================================
  Hits                774     774              
- Misses             9933    9956      +23     
Flag Coverage Δ
unittests 7.21% <28.12%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/utils/command.cpp 53.19% <ø> (ø)
src/utils/process.cpp 18.66% <17.85%> (-8.26%) ⬇️
tests/unit_tests/utils/process.cpp 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ccf14d9...89dc4b5. Read the comment docs.

@patrick96 patrick96 merged commit 47483a9 into polybar:hotfix/3.5.1 Dec 12, 2020
@patrick96 patrick96 deleted the fix/zombie-processes branch December 12, 2020 01:37
patrick96 added a commit that referenced this pull request Dec 12, 2020
Changelog

**Features**

* config: Multiple inheritance (#2271), see #2269

**Fixes**

* (#2285), see #770, #2289
* Timer module: Polybar crash when interval is set to 0 (#2274), see #2273
* `custom/menu`: Wrong level numbers in error messages (#2264)
* `internal/xworkspaces`: Ignored certain workspace updates (#2275), see #2272
* Logger: Undefined behavior (#2284)
* build:
    * Build issues in older clang versions (#2270, #2279, #2280)
@patrick96 patrick96 mentioned this pull request Dec 12, 2020
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant