Uploaded image for project: 'JS - JobScheduler'
  1. JS - JobScheduler
  2. JS-1635

warn_if_longer_than should work for shell jobs

    XMLWordPrintable

Details

    Description

      Current Situation

      We assume we have a "local" shell job with a warn_if longer_than setting but without a monitor or process_class.

      <job  warn_if_longer_than="00:02:00">
          <params />
          <script  language="shell">
              <![CDATA[
      echo %SCHEDULER_JOB_NAME% is running
      ping -n 180 127.0.0.1 > nul
              ]]>
          </script>
          <run_time />
      </job>
      

      then the task log doesn't have the warning

      [WARN]   SCHEDULER-712  Task runs longer than the expected duration of 00:02:00
      

      and no email is sent.

      Desired Behavior

      All jobs which runs longer than the warn_if longer_than setting should log a warning and an email is sent

      Workaround

      It works if the shell job has a monitor script or a process_class.

      Example with monitor script
      <job  warn_if_longer_than="00:02:00">
          <params />
          <script  language="shell">
              <![CDATA[
      echo %SCHEDULER_JOB_NAME% is running
      ping -n 180 127.0.0.1 > nul
              ]]>
          </script>
      
          <monitor  name="process0" ordering="0">
              <script  language="java:javascript">
                  <![CDATA[
      function spooler_task_after(){
        //nothing to do
      }
                  ]]>
              </script>
          </monitor>
          <run_time />
      </job>
      
      Example with process_class
      <job  warn_if_longer_than="00:02:00" process_class="local">
          <params />
          <script  language="shell">
              <![CDATA[
      echo %SCHEDULER_JOB_NAME% is running
      ping -n 180 127.0.0.1 > nul
              ]]>
          </script>
          <run_time />
      </job>
      

      where the local process class is e.g.

      <process_class max_processes="10" name="localhost" remote_scheduler="localhost:4444" />
      

      Attachments

        Activity

          People

            jz Joacim Zschimmer
            oh Oliver Haufe
            Oliver Haufe Oliver Haufe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: