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

Handle Missing jobStartTime in JSON Deserialization #153

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

kaituo
Copy link
Collaborator

@kaituo kaituo commented Nov 13, 2023

Description

  • Added handling for scenarios where jobStartTime is not present in the JSON input.
  • Ensures FlintInstance deserialization remains robust and error-free even when jobStartTime is missing.

Testing:

  1. Extended unit tests to cover the new case.
  2. Conducted manual sanity tests to ensure stability and correctness.

Issues Resolved

#152

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.

- Added handling for scenarios where jobStartTime is not present in the JSON input.
- Ensures FlintInstance deserialization remains robust and error-free even when jobStartTime is missing.

Testing:
  1. Extended unit tests to cover the new case.
  2. Conducted manual sanity tests to ensure stability and correctness.
Signed-off-by: Kaituo Li <[email protected]>
@@ -24,7 +24,7 @@ class FlintInstance(
var state: String,
val lastUpdateTime: Long,
// We need jobStartTime to check if HMAC token is expired or not
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -75,7 +78,13 @@ object FlintInstance {
val jobId = scalaSource("jobId").asInstanceOf[String]
val sessionId = scalaSource("sessionId").asInstanceOf[String]
val lastUpdateTime = scalaSource("lastUpdateTime").asInstanceOf[Long]
val jobStartTime = scalaSource("jobStartTime").asInstanceOf[Long]
// Safely extract 'jobStartTime' considering potential null or absence
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate log

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Signed-off-by: Kaituo Li <[email protected]>
@kaituo kaituo merged commit 594534e into opensearch-project:main Nov 14, 2023
4 checks passed
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