Forward SIGTERM to child process
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start by locating the codecoverage command entry point and the process-launching path that runs the wrapped dotnet child; no source file or test is named in the issue. Done means the child receives termination signals and the wrapper waits for it to terminate.
Written by the indexing model from the issue text.
Description
What
We have a .NET app which is wrapped in the codecoverage tool in our local development stack, like this:
exec /app/tools/dotnet-coverage collect --session-id "coverage-session" -f cobertura -o "/tmp/coverage/coverage-$(basename "${DLL_NAME}").xml" -- dotnet "$DLL_NAME" "$@"
Inside this application we have a service which hooks into the IHostApplicationLifetime interface to register an action on ApplicationStopping:
// Register shutdown
_hostApplicationLifetime.ApplicationStopping.Register(OnStopping);
However, when running the app wrapped in codecoverage, our OnStopping doesn't fire. That's because codecoverage itself ends up being PID 1 inside the container, and it doesn't pass the SIGTERM signal on to our own application:
$ ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
app 1 0.3 0.3 6180692 218940 ? Ssl 14:30 0:03 /app/tools/dotnet-coverage collect --session-id coverage-session -f cobertura -o /tmp/coverage/coverage-app.dll.xml -- dotnet /app/app.dll
app 17 0.4 0.3 8401572 242552 ? Sl 14:30 0:03 dotnet /app/app.dll
Proposed solution
codecoverage should pass on any kill signals it gets to the process that it's wrapping, and wait for the child process to terminate before terminating itself.
- Dominant language
- C#
- Stars
- 125
- Forks
- 17
- Avg merge
- 1h 17m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/codecoverage
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
microsoft/codecoverage#246 · 6 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
microsoft/codecoverage#234 · 1 comment · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
microsoft/codecoverage#233 · 2 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
microsoft/codecoverage#232 · 6 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
microsoft/codecoverage#220 · 1 comment ·
All issues in microsoft/codecoverage
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·