Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-4287

run.sh can consume 100% single CPU resources on Solaris

    XMLWordPrintable

Details

    Description

      When shutting down jboss the run.sh script remain alive and consumes 100% of a single CPUs resources. run.sh needs to be killed off.

      To trigger the bug, you need to

      1) set LAUNCH_JBOSS_IN_BACKGROUND
      2) start the jboss server normally
      3) Once it's started stop the server

      At this point the JVM stops, however the run.sh script remains running consuming 100% of a single CPUs resources.

      The problem seems to be this bit of script, plus the fact that the script shebang is #!/bin/sh

      while [ "$WAIT_STATUS" -ne 127 ]; do
      JBOSS_STATUS=$WAIT_STATUS
      wait $JBOSS_PID 2>/dev/null
      WAIT_STATUS=$?
      done

      On Solaris, /bin/sh is real bourne shell and the wait shell-built-in for /bin/sh on Solaris returns 0 (not 127) if the PID (passed as an argument) doesn't exist. The man page for wait states that this is the correct behaviour. Therefore wait returns 0 and the while loop continues forever burning up CPU resources (until you kill it with one of the signals not being trapped).

      Here's a link to the patch that may have introduced the bug.
      http://jira.jboss.com/jira/browse/JBAS-3748

      Attachments

        1. JBAS-4287.patch
          1 kB
        2. run.sh
          6 kB
        3. run.sh.patch
          1 kB

        Issue Links

          Activity

            People

              dandread1@redhat.com Dimitrios Andreadis
              quentena_jira Quenten Alick (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: