-
Notifications
You must be signed in to change notification settings - Fork 25.6k
(#34659) - Add Timezone Configuration to Watcher #117033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lukewhiting
merged 14 commits into
elastic:main
from
lukewhiting:34659-watcher-timezone-support
Nov 25, 2024
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ae7c608
Add timezone support to Cron objects
lukewhiting 69b442d
Add timezone support to CronnableSchedule
lukewhiting 1fd6555
XContent change to support parsing and display of TimeZone fields on …
lukewhiting 707ec04
Case insensitive timezone parsing
lukewhiting e922e8d
Doc changes
lukewhiting 56a0bd7
YAML REST tests
lukewhiting 0940d16
Equals, toString and HashCode now include timezone
lukewhiting 3991e5e
Additional random testing for DST transitions
lukewhiting 612a2db
Migrate Cron class to use wrapped LocalDateTime
lukewhiting 7a1cc72
Additional documentation to explain discontinuity event behaviour
lukewhiting e8c44bf
Remove redundant conversions from ZoneId to TimeZone following move t…
lukewhiting 7502b4f
Add documentation warning that manual clock changes will cause unpred…
lukewhiting 7872643
Merge branch 'main' of github.com:elastic/elasticsearch into 34659-wa…
lukewhiting 832e1ad
Update docs/reference/watcher/trigger/schedule.asciidoc
lukewhiting File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,42 @@ | |
++++ | ||
|
||
Schedule <<trigger,triggers>> define when the watch execution should start based | ||
on date and time. All times are specified in UTC time. | ||
on date and time. All times are in UTC time unless a timezone is explicitly specified | ||
in the schedule. | ||
|
||
{watcher} uses the system clock to determine the current time. To ensure schedules | ||
are triggered when expected, you should synchronize the clocks of all nodes in the | ||
cluster using a time service such as http://www.ntp.org/[NTP]. | ||
|
||
NOTE: {watcher} can't correct for manual adjustments to the system clock. Be aware when making | ||
such changes that watch execution may be affected with watches being skipped or repeated if the | ||
adjustment covers their target execution time. This applies to changes made via NTP as well. | ||
|
||
When specifying a timezone for a watch, keep in mind the effect daylight savings time | ||
transitions may have on the schedule, especially if the watch is scheduled to run | ||
during the transition. Here's how {watcher} handles watches scheduled during discontinuities: | ||
|
||
==== Gap Transitions | ||
These occur when the clock moves forward, such as when daylight savings time starts | ||
and cause certain hours or minutes to be skipped. If your watch is scheduled to run | ||
during a gap transition, the watch is executed at the same time as before the transition. | ||
|
||
Example: If a watch is scheduled to run daily at 1:30AM in the `Europe/London` time zone and | ||
the clock moves forward one hour from 1:00AM (GMT+0) to 2:00AM (GMT+1), the watch is executed | ||
at 2:30AM (GMT+1) which would have been 1:30AM before the transition. Subsequent executions | ||
happen at 1:30AM (GMT+1). | ||
|
||
==== Overlap Transitions | ||
These occur when the clock moves backward, such as when daylight savings time ends | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here about clarification for manual backward moves There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case it would re-execute the watch when it hits the target time again |
||
and cause certain hours or minutes to be repeated. If your watch is scheduled to run | ||
during an overlap transition, only the first occurrence of the time causes to the watch | ||
to execute with the second being skipped. | ||
|
||
Example: If a watch is scheduled to run at 1:30 AM and the clock moves backward one hour | ||
from 2:00AM to 1:00AM, the watch is executed at 1:30AM and the second occurrence after the | ||
change is skipped. | ||
|
||
=== Throttling | ||
Keep in mind that the throttle period can affect when a watch is actually executed. | ||
The default throttle period is five seconds (5000 ms). If you configure a schedule | ||
that's more frequent than the throttle period, the throttle period overrides the | ||
|
@@ -20,6 +50,7 @@ and set the schedule to every 10 seconds, the watch is executed no more than | |
once per minute. For more information about throttling, see | ||
<<actions-ack-throttle>>. | ||
|
||
=== Schedule Types | ||
{watcher} provides several types of schedule triggers: | ||
|
||
* <<schedule-hourly, `hourly`>> | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify if this also happens when the clock moves forward due to manual setting (e.g., if someone manually sets it 2 hours forward because it was incorrect)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No if someone (or NTP) moves the clock past a watch execution time, it will skip that execution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, what I meant was, could you add that clarification to the docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh right sure thing :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change pushed