Uploaded image for project: 'Oozie'
  1. Oozie
  2. OOZIE-2494

Cron syntax not handling DST properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 4.2.0, 5.0.0
    • 5.1.0
    • coordinator
    • None

    Description

      When specifying a coordinator frequency, you can also specify a "timezone". While the frequency is always calculated in UTC, the timezone’s DST rules are still applied. We can see this in the following two Coordinators, which ran across the DST shift (March 13 2016 at 2am) for the America/Los_Angeles timezone. The "el-UTC" job has "UTC" as the timezone, while the "el-LA" job has “America/Los_Angeles” as the timezone. Both jobs have a frequency of ${coord:days(1)}.

      Job Name    : el-UTC
      Start Time  : 2016-03-13 01:10 GMT | 2016-03-12 17:10 PST
      ---------------------------------------------------------
      ID     Nominal Time (UTC)       Nominal Time (LA)
      @1     2016-03-13 01:10 GMT     2016-03-12 17:10 PST
      @2     2016-03-14 01:10 GMT     2016-03-13 18:10 PDT
      
      Job Name    : el-LA
      Start Time  : 2016-03-13 01:10 GMT | 2016-03-12 17:10 PST
      ---------------------------------------------------------
      ID     Nominal Time (UTC)       Nominal Time (LA)
      @1     2016-03-13 01:10 GMT     2016-03-12 17:10 PST
      @2     2016-03-14 00:10 GMT     2016-03-13 17:10 PDT
      

      As you can see, @2’s nominal time is adjusted to an hour earlier in the "el-LA" job, but not in the "el-UTC" job.

      However, when running a similar set of jobs, but using cron syntax (10 1 1/1 * *, which indicates 1:10 every day of every month), this isn’t the case:

      Job Name    : cron-UTC
      Start Time  : 2016-03-13 01:08 GMT | 2016-03-12 17:08 PST
      ---------------------------------------------------------
      ID     Nominal Time (UTC)       Nominal Time (LA)
      @1     2016-03-13 01:10 GMT     2016-03-12 17:10 PST
      @2     2016-03-14 01:10 GMT     2016-03-13 18:10 PDT
      
      Job Name    : cron-LA
      Start Time  : 2016-03-13 01:08 GMT | 2016-03-12 17:08 PST
      ---------------------------------------------------------
      ID     Nominal Time (UTC)       Nominal Time (LA)
      @1     2016-03-13 01:10 GMT     2016-03-12 17:10 PST
      @2     2016-03-14 01:10 GMT     2016-03-13 18:10 PDT
      

      As you can see, @2’s nominal time are the same in both the "cron-UTC" and "cron-LA" jobs. The "cron-LA" job should have the same nominal time as the "el-LA" job from earlier.

      Attachments

        1. testActionMaterWithDST3.patch
          2 kB
          Kinga Marton
        2. OOZIE-2494-010.patch
          31 kB
          Kinga Marton
        3. OOZIE-2494-009.patch
          30 kB
          Kinga Marton
        4. OOZIE-2494-008.patch
          30 kB
          Kinga Marton
        5. OOZIE-2494-007.patch
          14 kB
          Kinga Marton
        6. OOZIE-2494-006.patch
          14 kB
          Kinga Marton
        7. OOZIE-2494-005.patch
          14 kB
          Kinga Marton
        8. OOZIE-2494-004.patch
          8 kB
          Peter Bacsko
        9. OOZIE-2494-003.patch
          6 kB
          Peter Bacsko
        10. OOZIE-2494-002.patch
          5 kB
          Peter Bacsko
        11. OOZIE-2494-001.patch
          4 kB
          Peter Bacsko
        12. CronExpressionPOC.java
          4 kB
          Peter Bacsko
        13. CoordinatorFunctionalSpec.html
          315 kB
          Kinga Marton

        Issue Links

          Activity

            People

              kmarton Kinga Marton
              dennisp Dennis Pallett
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: