Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-2631

poller-wrapper.py fails to log when log file is a fifo pipe in python 3

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • None
    • Professional Edition
    • Poller
    • CentOS 7, Python 3.4.5, PHP 7.2 from remirepo

    Description

      When the log file is a named fifo pipe or stdout (for injecting logs directly into journald) and the poller wrapper is running on Python 3, it fails with an "OSError: [Errno 29] Illegal seek" on the `f = open(log_path,'a')` line.

      This is a known but unsolved python 3 bug as can be seen here https://bugs.python.org/issue27805 and https://bugs.python.org/issue20074.

      The solution we used for now is to overwrite the open function to the open mode if appropriate, we did not want to modify the poller-wrapper directly to avoid issues with upgrades.

      `python3 poller-wrapper-wrapper.py poller-wrapper.py -w 10`

       

      poller-wrapper-wrapper.py is attached.

      Attachments

        1. OBS-2631.patch
          1 kB
          Gunnar Guðvarðarson
        2. poller-wrapper-wrapper.py
          0.6 kB
          Gunnar Guðvarðarson

        Activity

          People

            landy Mike Stupalov
            gunnarg Gunnar Guðvarðarson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: