Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-11295

Only main process unloads modules

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 2.2.16rc1, 3.0.6rc1, 3.2.2rc1, 3.4.0alpha1
    • Agent (G), Proxy (P), Server (S)
    • UNIX

      Many thanks to syepes for discovering this one!

      Start and stop Zabbix with at least one module to load, DebugLevel=4 and such modification of SIGTERM handler:

      Index: src/libs/zbxnix/sighandler.c
      ===================================================================
      --- src/libs/zbxnix/sighandler.c	(revision 62867)
      +++ src/libs/zbxnix/sighandler.c	(working copy)
      @@ -83,7 +83,7 @@
       		zabbix_log(sig_parent_pid == SIG_CHECKED_FIELD(siginfo, si_pid) || SIGINT == sig ?
       				LOG_LEVEL_DEBUG : LOG_LEVEL_WARNING,
       				"Got signal [signal:%d(%s),sender_pid:%d,sender_uid:%d,"
      -				"reason:%d]. %s ...",
      +				"reason:%d]. %s ... without unloading modules",
       				sig, get_signal_name(sig),
       				SIG_CHECKED_FIELD(siginfo, si_pid),
       				SIG_CHECKED_FIELD(siginfo, si_uid),
      

      Observe the log file:

        8751:20160930:125402.105 server #0 started [main process]
      ...
        8751:20160930:125410.301 Got signal [signal:15(SIGTERM),sender_pid:7446,sender_uid:1000,reason:0]. Exiting ...
        8751:20160930:125410.301 zbx_on_exit() called
        8756:20160930:125410.301 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8769:20160930:125410.301 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8780:20160930:125410.301 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8757:20160930:125410.302 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8765:20160930:125410.302 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8766:20160930:125410.303 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8781:20160930:125410.303 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8768:20160930:125410.304 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8786:20160930:125410.305 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8771:20160930:125410.305 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8773:20160930:125410.306 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8774:20160930:125410.306 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8775:20160930:125410.307 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8776:20160930:125410.307 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8777:20160930:125410.308 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8778:20160930:125410.308 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8779:20160930:125410.308 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8782:20160930:125410.308 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8784:20160930:125410.309 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8785:20160930:125410.309 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8764:20160930:125410.309 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8762:20160930:125410.310 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8758:20160930:125410.310 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8761:20160930:125410.311 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8783:20160930:125410.311 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8763:20160930:125410.312 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
        8787:20160930:125410.312 Got signal [signal:15(SIGTERM),sender_pid:8751,sender_uid:1000,reason:0]. Exiting ... without unloading modules
      ...
        8751:20160930:125412.317 In zbx_unload_modules()
        8751:20160930:125412.317 End of zbx_unload_modules()
        8751:20160930:125412.317 Zabbix Server stopped. Zabbix 3.3.0 (revision {ZABBIX_REVISION}).
      

      Probably zbx_on_exit() is not the right place for zbx_unload_modules(), it should be called by every Zabbix process.

      Marked as critical because now modules can export historical data and not calling zbx_module_uninit() for every history syncer process can lead to data loss if module does its own data buffering.

            Unassigned Unassigned
            glebs.ivanovskis Glebs Ivanovskis (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: