Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7904099

Scratch directory cleanup may end up deleting hs_err log file of a crashing agent server

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • jtreg7.1, jtreg8.1
    • tools
    • None

      jtreg can be instructed to retain contents of the scratch directory using the "retain" option. Typically usage of that option sets the values to "fail,error" to retain the contents of the scratch directory of a failing/erroring test.

      The working directory of a agent server JVM, which the jtreg process launches, is the same scratch directory that is allocated to the test that run on that agent. If a agent JVM crashes, then it writes out the hs_err<pid>.log file to that scratch directory.

      It has been noticed that in some situations, the test action running on the agent JVM may complete normally (i.e. status == passed) but just a few moments later, the agent JVM may crash (in some other thread). When that crash happens, the agent JVM starts writing out the hs_err<pid>.log file in the scratch directory. While that is happening, the jtreg process upon noticing that the test action has successfully completed and because retain is set to "fail,error", goes ahead and concurrently starts deleting the contents of the test's scratch directory. As a result, the hs_err<pid>.log file which was being written out (or was completely written out) gets deleted.

      Although jtreg itself isn't at fault here (it was instructed to retain the scratch directory only if the test action failed or errored and in this case the test action passed), there should be a better way to detect this situation so that crucial logs like the hs_err<pid>.log of a crashing agent JVM isn't lost.

            jpai Jaikiran Pai
            jpai Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: