Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-14772

Repeating interval with start date instantiates too often

    • Icon: Bug Report Bug Report
    • Resolution: Unresolved
    • Icon: L3 - Default L3 - Default
    • None
    • 7.17.0
    • engine
    • None

      Environment (Required on creation):

      Any Camunda environment.

      Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

      While creating a process definition with a repeating interval and a start date (example R2/2022-07-18T09:18:00Z/PT1M), the Camunda engine will instantiate one more process instance compared to the repeating interval number specified (3 instead of 2 in the example).

      Steps to reproduce (Required on creation):

      Execute the test included in this PR:
      https://github.com/camunda/camunda-bpm-platform/pull/1968

      or the test submitted by krisdacoder:

        @Test
        public void shouldNotExceedNumberPeriodsWithTimeCycle() throws Exception {
          ClockUtil.setCurrentTime(parse("19700101-00:00:00"));
          DurationHelper dh = new DurationHelper("R2/1970-01-01T00:30:00/PT2M");
          assertEquals(parse("19700101-00:30:00"), dh.getDateAfter());
      
          // simulate some execution time of 10 seconds
          ClockUtil.setCurrentTime(parse("19700101-00:30:10"));
          assertEquals(parse("19700101-00:31:00"), dh.getDateAfter());
      
          // simulate some execution time of 10 seconds
          ClockUtil.setCurrentTime(parse("19700101-00:31:10"));
          assertNull("There must not be more than 2 repetitions",   dh.getDateAfter());
        }
      

      or create a process definition with a repeating interval including a start date e.g., "R2/2022-07-18T09:18:00Z/PT1M".

      Observed Behavior (Required on creation):

      The number of process instances instantiated is equal to the number of repetitions + 1.

      Expected behavior (Required on creation):

      The number of process instances instantiated should be equal to the number of repetitions.

      Root Cause (Required on prioritization):

      This loop which calculates the next date calculates the repeats based on the start date. When the start date is part of the expression though this leads to the timer firing once when the start date is reached and then n times to match the expression of Rn repeats.

      Solution Ideas (Optional):

      Hints (optional):

        This is the controller panel for Smart Panels app

            [CAM-14772] Repeating interval with start date instantiates too often

            Hey krisdacoder. thanks for reaching out to us with this bug report. Great to see that you already wrote a test to reproduce the issue. This always helps with the investigation.

            I can confirm, that this is not expected and will be treated as a bug. When specifying a start date in the timer configuration like R2/1970-01-01T00:00:00/PT10S we expect the timer to fire two times. This is also documented with an example: https://docs.camunda.org/manual/latest/reference/bpmn20/events/timer-events/#timer-start-event

            If you are interested in fixing this bug, this would be very much appreciated. Just let us know here in the ticket. We can help you with questions if you need any assistance. Otherwise, I will be forwarding the ticket for prioritization. I can not say when we will be able to work on it though.

            Best,
            Miklas

            Miklas Boskamp added a comment - Hey krisdacoder . thanks for reaching out to us with this bug report. Great to see that you already wrote a test to reproduce the issue. This always helps with the investigation. I can confirm, that this is not expected and will be treated as a bug. When specifying a start date in the timer configuration like R2/1970-01-01T00:00:00/PT10S we expect the timer to fire two times. This is also documented with an example: https://docs.camunda.org/manual/latest/reference/bpmn20/events/timer-events/#timer-start-event If you are interested in fixing this bug, this would be very much appreciated. Just let us know here in the ticket. We can help you with questions if you need any assistance. Otherwise, I will be forwarding the ticket for prioritization. I can not say when we will be able to work on it though. Best, Miklas

            Hi krisdacoder,

            Thanks again for reporting this bug. We applied a fix which will be released with 7.18.0-alpha5 on the 13th of September and 7.17.4 this week.

            Have a great week.
            Best,
            Miklas

            Miklas Boskamp added a comment - Hi krisdacoder , Thanks again for reporting this bug. We applied a fix which will be released with 7.18.0-alpha5 on the 13th of September and 7.17.4 this week. Have a great week. Best, Miklas

            krisdacoder, apologies. We ran into some issues with our CI and the fix had to be rolled back for 7.17. This means it will not make it into the 7.17.4 release this week but will be released with 7.17.5 next month. Sorry for that.

            Miklas Boskamp added a comment - krisdacoder , apologies. We ran into some issues with our CI and the fix had to be rolled back for 7.17. This means it will not make it into the 7.17.4 release this week but will be released with 7.17.5 next month. Sorry for that.

            krisdacoder, sorry again. We decided not to include the fix in 7.17. Please let us know if that is an issue for you. Sorry for the confusion.

            Miklas Boskamp added a comment - krisdacoder , sorry again. We decided not to include the fix in 7.17. Please let us know if that is an issue for you. Sorry for the confusion.

            Hi krisdacoder, we have decided to revert the commit including the fix for this issue because we ran into some failures on our CI. Investing more time into resolving those failures is currently not justified given that this issue is kind of niche.
            If you are interested in driving this matter forward by implementing a fix yourself, feel free to do so. For reference here are the related links:

            Sorry for the back and forth.
            Best,
            Miklas

            Miklas Boskamp added a comment - Hi krisdacoder , we have decided to revert the commit including the fix for this issue because we ran into some failures on our CI. Investing more time into resolving those failures is currently not justified given that this issue is kind of niche. If you are interested in driving this matter forward by implementing a fix yourself, feel free to do so. For reference here are the related links: PR with initial bug fix Failing test Setup for failing test Sorry for the back and forth. Best, Miklas

            This ticket was migrated to github: https://github.com/camunda/camunda-bpm-platform/issues/2760. Please use this link for any future references and continue any discussion there.

            Thorben Lindhauer added a comment - This ticket was migrated to github: https://github.com/camunda/camunda-bpm-platform/issues/2760 . Please use this link for any future references and continue any discussion there.

              Unassigned Unassigned
              krisdacoder Kristjan Demiri
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: