-
Notifications
You must be signed in to change notification settings - Fork 0
Run as cronjob #55
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
Run as cronjob #55
Conversation
haphut
left a comment
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.
Great! Consider squashing at least the bug fix commit. And maybe version to 3.0.0 without RC as it's a breaking change?
LGTM otherwise.
fcc5870 to
189287b
Compare
* fix: Starting point * fix: Optimize db query result processing * Update common to 2.0.2.1 * Changes to closeQuery functionality --------- Co-authored-by: Timo Järvinen <timo.jarvinen@yahoo.com>
e60d60f to
a5d52e9
Compare
| } | ||
|
|
||
|
|
||
| public void firstExecuteQueryThenReleaseDbResourcesAndThenHandleResults(final AbstractResultSetProcessor processor) { |
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.
@haphut I'm trying to understand the idea here. this method looks exactly the same as the one above, executeAndProcessQuery, but it calls closeQuery only when an exception occurs, while the other does it always, in the finally block.
Is that intended?
To me it looks like we need to remove this method as the sequence described by the method name:
firstExecuteQuery_ThenReleaseDbResources_AndThenHandleResults
is achieved in JourneyResultSetProcessor#processResultSet method that:
- collects all items in memory
- closes the query
- saves them to redis
Next, would be to apply the same sequence in the other two processors, MetroJourneyResultSetProcessor and StopResultSetProcessor
|
|
||
| log.info("All data processed, thank you."); | ||
| } catch (SQLServerException sqlServerException) { | ||
| String msg = "SQLServerException during query, Driver Error code: " |
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.
This exception should propagate, so it gets caught in the main method, so that the pod would exit with a status code of 1, that would mark it as failed, so the cron job can be retried. We should then configure some retries at the cronjob level.
@haphut does it make sense?
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.
Agreed.
67444 Refactor cache boostrapper
Fixes AB#58303