Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-164

Joran IncludeAction does not close the input file stream in case of SaxParseException

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None
    • logback-core
    • None

    Description

      If parsing include file for a Joran configuration fails e.g. with a SaxParseException then the include file stream is not closed immediately. Depending on the operation system fixing the configuration file requires to stop the Java VM or perhaps to run the garbage collector explicitly.

      From IncludeAction.java:
      InputStream in = getInputStream(ec, attributes);

      try {
      if (in != null)

      { parseAndRecord(in, recorder); in.close(); }

      } catch (JoranException e)

      { addError("Error while parsing " + attributeInUse, e); }

      catch (IOException e)

      { // called if in.close did not work }

      The in.close() should be called in a finally block, so the the stream is ensured to be closed.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            mfranz@intershop.de Michael Franz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: