Uploaded image for project: 'JOC - JobScheduler Operations Center'
  1. JOC - JobScheduler Operations Center
  2. JOC-1369

Daily Plan - service crashes when a DateTimeException occurs

    XMLWordPrintable

Details

    • Fix
    • Status: Released (View Workflow)
    • Minor
    • Resolution: Fixed
    • 2.0.0
    • 2.4.1, 2.5.0
    • None
    • None

    Description

      Current Situation

      • When the Schedule Run-time contains an invalid Period definition (e.g. Period begin = 40) the Daily Plan crashes with the following exception (jetty.log):
        Exception in thread "Timer-7" java.time.format.DateTimeParseException: Text '2022-09-01 40:00:00' could not be parsed: Invalid value for HourOfDay (valid values 0 - 23): 40
        	at java.base/java.time.format.DateTimeFormatter.createError(DateTimeFormatter.java:2023)
        	at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1958)
        	at java.base/java.time.LocalDateTime.parse(LocalDateTime.java:494)
        	at com.sos.joc.classes.JobSchedulerDate.convertDateTimeZoneToTimeZone(JobSchedulerDate.java:286)
        	at com.sos.joc.dailyplan.common.PeriodResolver.addRepeat(PeriodResolver.java:91)
        	at com.sos.joc.dailyplan.common.PeriodResolver.addStartTimes(PeriodResolver.java:60)
        	at com.sos.joc.dailyplan.DailyPlanRunner.calculateStartTimes(DailyPlanRunner.java:843)
        	at com.sos.joc.dailyplan.DailyPlanRunner.generateDailyPlan(DailyPlanRunner.java:267)
        ....
        

      Desired Behaviour

      • The Daily Plan should not crash when an exception occurs.
      • The error message should contain details about the cause of the error and be logged in the appropriate log files (joc.log, service-dailyplan.log).

      Test Instructions

      • Create a schedule with Plan Order automatically=true and Repeat Interval = Repeat.
        • set values and Store your changes.
      • Use Edit JSON and overwrite the period with:
        "periods": [
                {
                  "begin": "40",
                  "end": "15:00:00",
                  "repeat": "01:00:00",
                  "whenHoliday": "SUPPRESS"
                }
              ]
        
      • Restart the Daily Plan service and check the (joc.log and service-dailyplan.log). log files.
      • Expected result: the Daily Plan service should generate orders for all schedules except schedule with the wrong begin time.

      Attachments

        Activity

          People

            re Robert Ehrlich
            re Robert Ehrlich
            Ajay Kumbhkar Ajay Kumbhkar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: