Skip to content
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

Fixes possible negative jitter #78

Merged
merged 1 commit into from
Nov 1, 2021
Merged

Conversation

dbbaughe
Copy link
Contributor

@dbbaughe dbbaughe commented Nov 1, 2021

Signed-off-by: Drew Baugher 46505179+dbbaughe@users.noreply.github.com

Description

Current logic of jitter allows a negative value to be set and throw an exception

2021-11-01T14:46:11,738][INFO ][o.o.j.s.JobScheduler     ] [integTest-0] Will delay -34267 miliseconds for next execution of job testing-01
...
[2021-11-01T14:46:20,547][INFO ][o.o.j.s.JobScheduler     ] [integTest-0] Will delay 32889 miliseconds for next execution of job testing-01
...
[2021-11-01T14:48:27,705][INFO ][o.o.j.s.JobScheduler     ] [integTest-0] Will delay -29262 miliseconds for next execution of job testing-01
[2021-11-01T14:48:27,707][ERROR][o.o.b.OpenSearchUncaughtExceptionHandler] [integTest-0] uncaught exception in thread [opensearch[integTest-0][open_distro_job_scheduler][T#3]]
java.lang.IllegalArgumentException: duration cannot be negative, was given [-2158096000]
        at org.opensearch.common.unit.TimeValue.<init>(TimeValue.java:65) ~[opensearch-core-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
        at org.opensearch.jobscheduler.scheduler.JobScheduler.reschedule(JobScheduler.java:201) ~[?:?]
        at org.opensearch.jobscheduler.scheduler.JobScheduler.lambda$reschedule$0(JobScheduler.java:188) ~[?:?]
        at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:733) ~[opensearch-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[?:?]
        at java.lang.Thread.run(Thread.java:832) [?:?]
...

ISM job fails to run after that, this appears to have be introduced with the recent change of adding support for using jitter in ISM (opensearch-project/index-management@ab12279), as previously ISM was not using it in OpenSearch and would not have hit this issue.

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>
@dbbaughe dbbaughe merged commit 515ce06 into opensearch-project:main Nov 1, 2021
@dbbaughe dbbaughe deleted the jitter branch November 1, 2021 23:07
qreshi added a commit that referenced this pull request Nov 4, 2021
* Enabled automated license header checks (#36)

1. Re-enabled the 'licenseHeaders' check in the build.gradle file.
2. Added an IntelliJ copyright profile to auto-generate the SPDX license header.

Signed-off-by: Ketan Verma <ketan9495@gmail.com>

* Release 1.0.0.0 (#40)

Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>

* Bumping job-scheduler to build with OpenSearch(main) 1.1.0 (#44)

* Bumping job-scheduler to build with OpenSearch(main) 1.1.0

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>

* Updating docs link to our documentation website.

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>

* Using 1.1 snapshot version for OpenSearch (#48)

Signed-off-by: Vacha <vachshah@amazon.com>

* Use standard snapshot build settings and OpenSearch 1.x. (#49)

Signed-off-by: dblock <dblock@amazon.com>

* Add `Getting Started` to Readme  (#50)

* added Getting Started section

* Adds a delay parameter to the job scheduler (#61)

* Adds delay parameter to job scheduler

* Adds tests for job scheduler delay parameter

* Changes test and build workflow to 1.1 and corrects links

Signed-off-by: Clay Downs <downsrob@amazon.com>

* Updates job scheduler version to 1.2 (#68)

* Updates job scheduler version to 1.2 and uses Maven for 1.2 dependencies

Signed-off-by: Clay Downs <downsrob@amazon.com>

* Publish MD5 and SHA1 signatures. (#71)

* Publish MD5 and SHA1 signatures.

Signed-off-by: dblock <dblock@dblock.org>

* Also publish 256 and 512 checksums.

Signed-off-by: dblock <dblock@dblock.org>

* Fixes possible negative jitter (#78)

Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>

Co-authored-by: Ketan Verma <ketanv3@users.noreply.github.com>
Co-authored-by: Bowen Lan <62091230+bowenlan-amzn@users.noreply.github.com>
Co-authored-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
Co-authored-by: Vacha <vachshah@amazon.com>
Co-authored-by: Daniel Doubrovkine (dB.) <dblock@dblock.org>
Co-authored-by: Sriram <59816283+skkosuri-amzn@users.noreply.github.com>
Co-authored-by: Clay Downs <89109232+downsrob@users.noreply.github.com>
Co-authored-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>
wuychn pushed a commit to ochprince/job-scheduler that referenced this pull request Mar 16, 2023
Signed-off-by: Drew Baugher <46505179+dbbaughe@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants