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 [email protected]

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.

@dbbaughe dbbaughe requested review from downsrob and thalurur November 1, 2021 22:03
@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 <[email protected]>

* Release 1.0.0.0 (#40)

Signed-off-by: bowenlan-amzn <[email protected]>

* 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 <[email protected]>

* Updating docs link to our documentation website.

Signed-off-by: Sarat Vemulapalli <[email protected]>

* Using 1.1 snapshot version for OpenSearch (#48)

Signed-off-by: Vacha <[email protected]>

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

Signed-off-by: dblock <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* Publish MD5 and SHA1 signatures. (#71)

* Publish MD5 and SHA1 signatures.

Signed-off-by: dblock <[email protected]>

* Also publish 256 and 512 checksums.

Signed-off-by: dblock <[email protected]>

* Fixes possible negative jitter (#78)

Signed-off-by: Drew Baugher <[email protected]>

Co-authored-by: Ketan Verma <[email protected]>
Co-authored-by: Bowen Lan <[email protected]>
Co-authored-by: Sarat Vemulapalli <[email protected]>
Co-authored-by: Vacha <[email protected]>
Co-authored-by: Daniel Doubrovkine (dB.) <[email protected]>
Co-authored-by: Sriram <[email protected]>
Co-authored-by: Clay Downs <[email protected]>
Co-authored-by: Drew Baugher <[email protected]>
wuychn pushed a commit to ochprince/job-scheduler that referenced this pull request Mar 16, 2023
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.

2 participants