Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-36236

Confluence use of -Xloggc with a ":" no longer works in Java 7u76 (and Java 8)

    XMLWordPrintable

Details

    Description

      In Java 7u76 (as well as Java 8), the -Xloggc no longer accepts filenames with a ":" in it.

      In setenv.sh, Confluence uses -Xloggc with an argument calculated from "date +%F_%T" which turns into a filename containing ":":

      CATALINA_OPTS="$CATALINA_OPTS -Xloggc:$LOGBASEABS/logs/gc-`date +%F_%T`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M"
      

      According to the Java change:

      http://bugs.java.com/view_bug.do?bug_id=7164841

      New solution is, we parameterize the input file name for -Xloggc:<filename>, filename is restricted for characters '[A-Z][a-z][0-9][.][-][_]', it only restricts filename not path.

      In my instance, I changed it to:

      CATALINA_OPTS="$CATALINA_OPTS -Xloggc:'$LOGBASEABS/logs/gc-%t.log' -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M"
      

      However, the %t only works in Java 7u76 and Java 8. To maintain portability with earlier versions, you might explicitly expand the "date +%T" to use "hh_mm_ss" or some such expansion.

      Technically, this might not be a bug. But, due to Java behaviour changing with 7u76, the existing Confluence implementation no longer works out of box with Java 7, which makes it a bug "after the fact". If you think another issue type is appropriate based upon Atlassian policy, that's fine, as long as this does get fixed...

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              02b1b11374fa markmielke
              Votes:
              4 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: