Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-10018

logging FileAppender does not close files after use

    Details

    • Type: Bug
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: log
    • Labels:
      None
    • Team:
      Data Access and Database

      Description

      Running the attached test file exposes a problem with using FileAppender.

      $ python small.py
      .File open: /home/srp/mine/legacy-ctrl_events/tests/test.log
      F.
      ======================================================================
      FAIL: testFileDescriptorLeaks (__main__.smallMemoryTestCase)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/scratch/srp/lsstsw/stack/Linux64/utils/13.0/python/lsst/utils/tests.py", line 178, in testFileDescriptorLeaks
          self.fail("Failed to close %d file%s" % (len(diff), "s" if len(diff) != 1 else ""))
      AssertionError: Failed to close 1 file
      

      As a side note, since the file isn't flushed at any point, the test.log file ends up being empty. edit: this is because it was being sent to trace, not info.

      The tests in lsst.log don't use the lsst.utils.tests framework so this bug wasn't exposed. Additionally, the test that is there in testLog.py names the file "

      {0}

      " - I'm not sure what this was supposed to be

        Attachments

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              spietrowicz Steve Pietrowicz
              Watchers:
              Andy Salnikov, John Swinbank, Perry Gee, Steve Pietrowicz, Tim Jenness
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel