Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destroy the process during coroutine cancellation #7

Merged
merged 3 commits into from
Aug 5, 2021

Conversation

pgreze
Copy link
Owner

@pgreze pgreze commented Aug 3, 2021

Aiming to address #5 relying on the thread I opened in the Kotlin Slack: https://kotlinlang.slack.com/archives/C1CFAFJSK/p1627981249052500

#6 was initially proposed but it was not enough, because relying on a process with an active stdout (see the EndlessInputStream).
I considered several alternatives, including:

  1. a 3rd async to regularly check the isActive state, and/or
  2. add support for cancellation on all stdin/stdout operations, not just the stdout one.

At the end, have both should ensure cancelled operations for most cases.

@github-actions
Copy link

github-actions bot commented Aug 3, 2021

Unit Test Results

  7 files  ±0    7 suites  ±0   4s ⏱️ ±0s
23 tests ±0  23 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit a565a6e. ± Comparison against base commit a565a6e.

♻️ This comment has been updated with latest results.

@pgreze pgreze changed the title [WIP] Destroy the process during coroutine cancellation Destroy the process during coroutine cancellation Aug 4, 2021
@pgreze pgreze marked this pull request as ready for review August 4, 2021 04:00
@pgreze pgreze force-pushed the progress-destroy-during-cancel branch from 246c46d to 7915147 Compare August 4, 2021 06:15
@codecov-commenter
Copy link

Codecov Report

Merging #7 (7915147) into main (4043ea9) will decrease coverage by 1.45%.
The diff coverage is 57.14%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main       #7      +/-   ##
============================================
- Coverage     76.11%   74.66%   -1.46%     
  Complexity        3        3              
============================================
  Files             4        4              
  Lines            67       75       +8     
  Branches         33       37       +4     
============================================
+ Hits             51       56       +5     
- Partials         16       19       +3     
Impacted Files Coverage Δ
...c/main/kotlin/com/github/pgreze/process/Process.kt 68.88% <57.14%> (-1.39%) ⬇️

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 4043ea9...7915147. Read the comment docs.

@pgreze pgreze merged commit a565a6e into main Aug 5, 2021
@pgreze pgreze deleted the progress-destroy-during-cancel branch August 5, 2021 03:25
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.

2 participants