Menu

#581 OpenSAF daemons should terminate by calling exit()

future
assigned
None
enhancement
osaf
-
4.3
major
2015-03-16
2013-10-01
Hans Feldt
No

migrated from http://devel.opensaf.org/ticket/2615

Two purposes:
- enable code coverage analysis, gcov requires a clean exit of the process to flush coverage data to file
- logging point

Solution: a common SIGTERM handler in daemon.c that logs and exit the process. Any daemon that wants to override this (e.g. amfnd) just install its own SIGTERM handler after calling daemonize()

Related

Tickets: #581

Discussion

  • Hans Feldt

    Hans Feldt - 2013-10-01
    • Type: defect --> enhancement
     
  • Hans Feldt

    Hans Feldt - 2013-10-01

    Status:
    - daemon_exit() calls _Exit() which does not call exit handlers which I believe gcov_flush is one of. This results in no coverage for some daemons for example amfd.

    Proposals:
    alt1) using pragma for weak linking check for symbol gcov_flush and call it if available before calling _Exit()

    alt2) change _Exit() to exit(), not as safe and requires other threads to be shutdown first. Perhaps calling ncs_agent_shutdown() also in daemon_exit() ?

     
  • Hans Feldt

    Hans Feldt - 2013-10-01

    and some services (CKPT, IMM) are still not adapted

     
  • Hans Nordebäck

    Hans Nordebäck - 2013-12-17
    • status: accepted --> fixed
     
  • Hans Nordebäck

    Hans Nordebäck - 2013-12-17

    changeset: 4740:e88a997a8d61
    tag: tip
    user: Hans Nordeback hans.nordeback@ericsson.com
    date: Tue Dec 17 12:48:18 2013 +0100
    files: osaf/libs/core/common/daemon.c
    description:
    base: use _Exit instead of exit in daemon_exit. [#581]

    The change was done due to
    that exit() is not thread safe, see e.g. ticket #651.
    To make it possible to dump e.g. coverage data on termination
    a weak reference to __gcov_flush has been added.

     

    Related

    Tickets: #581

  • Hans Feldt

    Hans Feldt - 2013-12-19
    • status: fixed --> accepted
     
  • Hans Feldt

    Hans Feldt - 2013-12-19

    this ticket is not fixed yet! A few services remain to be fixed

     
  • Hans Feldt

    Hans Feldt - 2013-12-19

    IMM patches pending for review
    Now missing e.g. ckpt

     
  • Hans Feldt

    Hans Feldt - 2013-12-19

    changeset: 4749:1aa3223aa903
    user: Hans Feldt hans.feldt@ericsson.com
    date: Thu Dec 19 09:28:13 2013 +0100
    summary: immd: use daemon_sigterm_install (#581)

    changeset: 4750:85a453678667
    tag: tip
    user: Hans Feldt hans.feldt@ericsson.com
    date: Thu Dec 19 09:28:14 2013 +0100
    summary: immnd: use daemon_sigterm_install (#581)

     
  • Hans Feldt

    Hans Feldt - 2013-12-27

    changeset: 4772:e64cd4d03118
    user: Hans Feldt hans.feldt@ericsson.com
    date: Thu Dec 19 16:56:17 2013 +0100
    summary: cpd: use daemon_sigterm_install [#581]

    changeset: 4773:9d2025e17a54
    tag: tip
    user: Hans Feldt hans.feldt@ericsson.com
    date: Thu Dec 19 16:56:18 2013 +0100
    summary: cpnd: use daemon_sigterm_install [#581]

     

    Related

    Tickets: #581

  • Hans Feldt

    Hans Feldt - 2014-01-07

    edsv, glsv, mqsv & dtm remains

     
  • Hans Feldt

    Hans Feldt - 2014-01-07
    • status: accepted --> unassigned
     
  • Hans Feldt

    Hans Feldt - 2014-01-07
    • assigned_to: Hans Feldt --> nobody
     
  • Anders Widell

    Anders Widell - 2014-01-09
    • Milestone: 4.4.FC --> 4.5.FC
     
  • Anders Widell

    Anders Widell - 2014-08-15
    • Milestone: 4.5.FC --> 4.6.FC
     
  • Mathi Naickan

    Mathi Naickan - 2015-03-16
    • status: unassigned --> assigned
    • assigned_to: Mathi Naickan
    • Milestone: 4.6.FC --> future
     

Log in to post a comment.