-
Notifications
You must be signed in to change notification settings - Fork 33
[MOB-2899] - Health Monitoring for Offline Processor #345
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
[MOB-2899] - Health Monitoring for Offline Processor #345
Conversation
757597c to
4f0bd2d
Compare
1. Dont schedule for offline processing if row count exceeds max allowed number 2. Max offline operation is set to 1000 3. Added mock task storage in initializer for testing
4f0bd2d to
09e81a7
Compare
Codecov Report
@@ Coverage Diff @@
## master #345 +/- ##
==========================================
- Coverage 70.57% 69.45% -1.13%
==========================================
Files 60 61 +1
Lines 3715 3765 +50
Branches 433 438 +5
==========================================
- Hits 2622 2615 -7
- Misses 828 895 +67
+ Partials 265 255 -10
Continue to review full report at Codecov.
|
1. Healthmonitor now access Iterable task storage to directly access db and to understand if its ready 2. Introducing Healthmonitorhandler with idea that whoever subscribes to healthmonitor (in our case Taskrunner), should understand if something goes wrong and make it immediately switch to online. This is not implemented yet 3. IterableTaskStorageHandler (may be not a good idea. Might have to remove this)
1. Interface at IterableTaskStorage which will notify all DB errors to Healthmonitor. This will be used by healthmonitor to keep its flag 'errored' updated. 2. canSchedule and canProcess will now be checked through this flag in healthmonitor 3. Updated existing test methods which were failing because of this changes as it needed healthmonitoring mock in them 4. Made some improvements where healthmonitor was being initialized reperatedly. Still pending: 1. should canProcess and canSchedule be based on just one flag - errored in healthMonitor? 2. Is there a technique to switch back to offline mode? after we set errored flag to true?
8f3949c to
d5801fe
Compare
1. DB method numberOfTasks now throws exception. Although we can still add exception handling in other methods in TaskStorage as well, this should cover it all. This should suffice as it internally checks for if the database is ready and throws an exception if its not. This method is also called during canSchedule which makes it a busy node for every request being made during offline request processing. 2. Added test method for canSchedule. Canprocess test is still pending
329cdb7 to
3a3cc94
Compare
0906eb8 to
2161969
Compare
1. DB initialization was taking wrong context instead of the one passed into it. 2. Above change enabled writing test for healthMonitor's canProcess function. 3. getRemoteCongifuration now looks for "SDKOfflineModeBeta" instead of "offlineModeBeta" to enable offline mode 4. Reverting back to our previous implementation of apiclient where we dont have different requestProcessor in apiclient. It will remain abstract in apiclient layer
2161969 to
7525fb2
Compare
iterableapi/src/main/java/com/iterable/iterableapi/IterableTaskStorage.java
Outdated
Show resolved
Hide resolved
iterableapi/src/main/java/com/iterable/iterableapi/IterableTaskStorage.java
Outdated
Show resolved
Hide resolved
iterableapi/src/main/java/com/iterable/iterableapi/IterableConstants.java
Outdated
Show resolved
Hide resolved
iterableapi/src/main/java/com/iterable/iterableapi/HealthMonitor.java
Outdated
Show resolved
Hide resolved
iterableapi/src/main/java/com/iterable/iterableapi/IterableTaskStorage.java
Outdated
Show resolved
Hide resolved
iterableapi/src/main/java/com/iterable/iterableapi/HealthMonitor.java
Outdated
Show resolved
Hide resolved
iterableapi/src/main/java/com/iterable/iterableapi/IterableTaskStorage.java
Show resolved
Hide resolved
iterableapi/src/main/java/com/iterable/iterableapi/IterableTaskStorage.java
Outdated
Show resolved
Hide resolved
iterableapi/src/main/java/com/iterable/iterableapi/OfflineRequestProcessor.java
Outdated
Show resolved
Hide resolved
3102b30 to
102e5be
Compare
davidtruong
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.
LFTM
Adding suggested changes from PR reviews Also added error check while creatin-> inserting task into DB
102e5be to
e32b4b5
Compare
🔹 Jira Ticket(s) if any
https://iterable.atlassian.net/browse/MOB-2899
✏️ Description