Skip to content

Fixing bug to successfully kill AppHealth Gracefully & VMWatch. #59

Merged
frank-pang-msft merged 4 commits intofeature/v2/bootstrapVMWatchfrom
feature/v2/bootstrapVMWatch_processleakfix
Mar 19, 2024
Merged

Fixing bug to successfully kill AppHealth Gracefully & VMWatch. #59
frank-pang-msft merged 4 commits intofeature/v2/bootstrapVMWatchfrom
feature/v2/bootstrapVMWatch_processleakfix

Conversation

@klugorosado
Copy link
Collaborator

@klugorosado klugorosado commented Mar 18, 2024

Changes by @dpoole73

  • Fix bug where we were not using the global vmWatchCommand variable so the SIGTERM handler was not killing anything
  • set the Pdealthsig property on the command so the SIGTERM signal is sent to the sub process on parent process termination

This fixes both issues:

Before the fix if we killed app health process, vmwatch process was always leaked

After the fix:
kill <pid> -> log message "Received shutdown request" and kill vmwatch.
kill -9 <pid>-> no log message, vmwatch is killed

Changes by @klugorosado

  • Added Integration tests to kill AppHealth Gracefully with SIGTERM and SIGINT, and validated VMWatch Shutdown.
  • Added Integration tests to kill AppHealth Forcibly with SIGKILL, and validated VMWatch Shutdown.
  • Added the capability for dev containers to run Integration tests inside.

dpoole73 and others added 3 commits March 15, 2024 11:38
1. Fix bug where we were not using the global vmWatchCommand variable so the SIGTERM hanlder was not killing anything
1. set the `Pdealthsig` property on the command so the SIGTERM signal is sent to the sub process on parent process termination

This fixes both issues:

Before the fix if we kill app health vmwatch was always leaked

After the fix:
`kill <pid>` -> log message "Received shutdown request" and kill vmwatch.
`kill -9 <pid>`-> no log message, vmwatch is killed

Tests still need to be added, kevin is going to add those
- Added additional vscode extensions recomendations.
- Added test_helper.bash to bats container
- Added 2 additional integration tests in 7_vmwatch.bats so kill AppHealth process gracefully
@klugorosado klugorosado added the bug Something isn't working label Mar 18, 2024
@klugorosado klugorosado marked this pull request as ready for review March 18, 2024 19:54
Copy link
Collaborator

@frank-pang-msft frank-pang-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just nits.

@frank-pang-msft frank-pang-msft merged commit 3ae2bd3 into feature/v2/bootstrapVMWatch Mar 19, 2024
klugorosado added a commit that referenced this pull request May 15, 2024
Changes by @dpoole73 
- Fix bug where we were not using the global `vmWatchCommand` variable so the SIGTERM handler was not killing anything
- set the `Pdealthsig` property on the command so the SIGTERM signal is sent to the sub process on parent process termination

This fixes both issues:

Before the fix if we killed app health process, vmwatch process was always leaked

After the fix:
`kill <pid>` -> log message "Received shutdown request" and kill vmwatch.
`kill -9 <pid>`-> no log message, vmwatch is killed

Changes by @klugorosado 
- Added Integration tests to kill AppHealth Gracefully with SIGTERM and SIGINT, and validated VMWatch Shutdown. 
- Added Integration tests to kill AppHealth Forcibly with SIGKILL, and validated VMWatch Shutdown. 
- Added the capability for dev containers to run Integration tests inside.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants