<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Using interval-origin in monitor operation definition does not work any more.</div>

<div>Veryfied on Pacemaker 1.1.10, but we think it does not work since 1.1.8 until now.</div>

<div> </div>

<div>Pengine calculates start delay in function unpack_operation and calls there crm_time_subtract.</div>

<div> </div>

<div>The call to crm_time_subtract with</div>

<div>origin=2014-03-31 19:20:00Z</div>

<div>date_set->now=2014-03-31 17:31:04Z</div>

<div>result in</div>

<div>delay=-0001-12-31 01:48:56Z</div>

<div>delay_s=31456136</div>

<div>start_delay=31456136000</div>

<div>which is almost a year in the future.</div>

<div> </div>

<div>The function crm_time_subtract calculates this by the crm_time_add_* functions.</div>

<div> </div>

<div>The buggy statement is in crm_time_add_days.</div>

<div>If the calculated number of days is zero, it subtracts one year and add the number of days, in this case 365.</div>

<div>But if a_time->days is zero, it must not do anything.</div>

<div> </div>

<div>The function crm_time_get_seconds, which is called by unpack_operation cannot handle negative years, so it ignores the year -1 but adds 365 days.</div>

<div> </div>

<div>There are two solutions.</div>

<div>One is the add handling on negative years to crm_time_get_seconds.</div>

<div>The other is to exchange line 1140 in iso8601.c</div>

<div><span class="k">while</span> <span class="p">(</span><span class="n">a_time</span><span class="o">-></span><span class="n">days</span> <span class="o"><=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span></div>

<div>
<div><span class="p">by</span></div>

<div>while (a_time->days < 0) {</div>

<div> </div>

<div>Second solution is verified to bring the expected result, start-delay of little less than two hours.</div>

<div>Handling of negative years in crm_time_get_seconds might not be a proper solution as the return value of the function is unsigned long long and what to report if the complete calculation gives a negative number of seconds.</div>

<div> </div>

<div>Rainer</div>

<div> </div>
</div></div></body></html>