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

Service ignores POSIX SIGINT/SIGTERM signals #74

Closed
tonyespy opened this issue May 14, 2020 · 0 comments
Closed

Service ignores POSIX SIGINT/SIGTERM signals #74

tonyespy opened this issue May 14, 2020 · 0 comments
Assignees
Labels
1-low priority denoting isolated changes app-services subsystem_affected for application services bug Something isn't working hanoi Hanoi release
Milestone

Comments

@tonyespy
Copy link
Member

The POSIX SIGINT/SIGTERM signals seem to be ignored by app-service-configurable. This prevents systemd from cleanly shutting down the service via SIGTERM when deployed via the snap or a native systemd service unit. Likewise, if a developer runs the service natively on a POSIX compliant system, ctrl-C (which generates SIGINT) will be ignored.

Here's the journal output on an Ubuntu 18.04 system with the latest geneva edgexfoundry snap (from the edge channel) installed:

09:10:01 edgexfoundry.app-service-configurable[8162]: level=INFO ts=2020-05-14T13:10:01.95915984Z app=AppService-rules-engine source=sdk.go:173 msg="Terminating: terminated"
09:10:32 systemd[1]: snap.edgexfoundry.app-service-configurable.service: State 'stop-sigterm' timed out. Killing.
09:10:32 systemd[1]: snap.edgexfoundry.app-service-configurable.service: Killing process 8162 (app-service-con) with signal SIGKILL.
09:10:32 systemd[1]: snap.edgexfoundry.app-service-configurable.service: Main process exited, code=killed, status=9/KILL
09:10:32 systemd[1]: snap.edgexfoundry.app-service-configurable.service: Failed with result 'timeout'.

Steps to reproduce (natively):

  • build the service from the latest v1.1.0 tag
  • bring up the latest EdgeX via the snap (see below) or docker-compose
  • start the service in the foreground
  • enter ctrl-C

Steps to reproduce with the edgefoundry snap (which bundles app-service-configurable for builtin rules-engine integration) on an Ubuntu LTS release (eg. 16.04, 18.04, or 20.04 or corresponding Core version):

  • in a separate terminal window run: $ sudo journalctl -f
  • install the snap: $ sudo snap install edgexfoundry --edge
  • enable one of the rules engines: $ sudo snap set edgexfoundry kuiper=on
  • disable the rules engine: $ sudo snap set edgexfoundry kuiper=off
  • notice that the command takes a long time to complete, and review the log output in the other terminal window

The other related issue is that after the service is finally stopped, Consul continually logs failed health checks for the service. I can open a separate issue for this...

May 14 09:36:58 sumo edgexfoundry.consul[5778]: 2020-05-14T09:36:58.893-0400 [WARN] agent: Check is now critical: check="Health Check: AppService-rules-engine"

@tonyespy tonyespy changed the title Service ignores SIGINT signal Service ignores POSIX SIGINT/SIGTERM signals May 14, 2020
@lenny-goodell lenny-goodell added the bug Something isn't working label May 15, 2020
@lenny-goodell lenny-goodell added 1-low priority denoting isolated changes app-services subsystem_affected for application services hanoi Hanoi release labels Jun 12, 2020
@lenny-goodell lenny-goodell added this to the Hanoi milestone Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-low priority denoting isolated changes app-services subsystem_affected for application services bug Something isn't working hanoi Hanoi release
Projects
None yet
Development

No branches or pull requests

3 participants