ServiceMix
  1. ServiceMix
  2. SM-2118

Container is in inconsistent state just after start

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.2
    • Fix Version/s: 3.4.0
    • Component/s: servicemix-core
    • Labels:
    • Environment:

      Linux, HP-UX, jdk6

    • Patch Info:
      Patch Available

      Description

      Start script returns control just after java process was launched. But components and service assemblies that were previously installed/deployed will continue to be loaded/initialized in background. This process may time few seconds but in reality when large number of components and SAs were previously deployed it may take minutes on busy server. If container was started by some script and then this script does something with container (like checking state of components and SAs, deploying things, etc) it is very likely to fail. Instead smx start script should hold control until container actually finishes starting up or time outs.

        Activity

        Hide
        Nikolay Martynov added a comment -

        Added patch that (if configured) creates marker file when container finishes starting.

        Show
        Nikolay Martynov added a comment - Added patch that (if configured) creates marker file when container finishes starting.
        Hide
        Nikolay Martynov added a comment -

        In our slightly modified start script we delete marker file before launching java process:
        test -f $rootDir/$startupFinishedMarkerFileName && rm $rootDir/$startupFinishedMarkerFileName
        Then after launching java process we wait until container finishes starting:
        periods=$(( $start_timeout / $start_poll_period ))
        while ps -p $pid && test $periods -gt 0 && ! test -f $rootDir/$startupFinishedMarkerFileName
        do
        sleep $start_poll_period
        periods=$(( $periods - 1 ))
        done
        This ensures that container is fully initialized before anyone tries to do something with it. This works on RHEL 5.3 and HP-UX i11.

        Show
        Nikolay Martynov added a comment - In our slightly modified start script we delete marker file before launching java process: test -f $rootDir/$startupFinishedMarkerFileName && rm $rootDir/$startupFinishedMarkerFileName Then after launching java process we wait until container finishes starting: periods=$(( $start_timeout / $start_poll_period )) while ps -p $pid && test $periods -gt 0 && ! test -f $rootDir/$startupFinishedMarkerFileName do sleep $start_poll_period periods=$(( $periods - 1 )) done This ensures that container is fully initialized before anyone tries to do something with it. This works on RHEL 5.3 and HP-UX i11.
        Hide
        Jean-Baptiste Onofré added a comment -

        Revision 1164060.

        I modified the patch to avoid dependency to commons-io and use clean variable names.

        Show
        Jean-Baptiste Onofré added a comment - Revision 1164060. I modified the patch to avoid dependency to commons-io and use clean variable names.

          People

          • Assignee:
            Jean-Baptiste Onofré
            Reporter:
            Nikolay Martynov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development