SAMZA-2595: Updated MonitorService to use separate ScheduleExecutor for each monitor#1434
Conversation
samza-rest/src/main/java/org/apache/samza/monitor/SamzaMonitorService.java
Show resolved
Hide resolved
samza-rest/src/main/java/org/apache/samza/monitor/SamzaMonitorService.java
Outdated
Show resolved
Hide resolved
samza-rest/src/main/java/org/apache/samza/monitor/SamzaMonitorService.java
Outdated
Show resolved
Hide resolved
samza-rest/src/main/java/org/apache/samza/monitor/SamzaMonitorService.java
Outdated
Show resolved
Hide resolved
3fa5634 to
f0d4110
Compare
| * Creates a ScheduledThreadPoolExecutor with core pool size 1 | ||
| * @return ScheduledExecutorService | ||
| */ | ||
| private ScheduledExecutorService createScheduler() { |
There was a problem hiding this comment.
Just curious.
Initially we had a single threaded scheduler to ensure when two monitors in samza-admin are trying to update/modify some shared state(either on disk or in some external store), then their executions are serialized. How are we planning to achieve that goal when we allow multiple monitors to be running at the same time in their own threads.
There was a problem hiding this comment.
We've already run into performance limits of what single threaded execution for all monitors can do with some monitors within LinkedIn, so while the current implementation avoided premature optimization, it's not sustainable. A better way to achieve the exclusivity goal will be to write the monitors with such side-effects in a "thread-safe" way. @shanthoosh are you aware of any existing monitors could be impacted by this change? If so, we can update them.
Shekhar, let's also call this out as another potentially backwards incompatible change in the "API changes" section.
There was a problem hiding this comment.
are you aware of any existing monitors could be impacted by this change?
Let's please double-check if the parallel execution of monitors(StateStoreGCMonitor, StateStoreDeltaMonitor) internally could potentially cause any correctness issues.
Other than that, updating the API spec of Monitor abstraction(& calling out backwards compatibility) should be sufficient.
There was a problem hiding this comment.
Ack, thanks for the heads up!
095fd97 to
3dad3d9
Compare
3dad3d9 to
b9b1c53
Compare
…or each monitor (apache#1434) Co-authored-by: Shekhar Sharma <shesharm@shesharm-mn2.linkedin.biz>
Symptoms:
Cause:
Fix:
Test:
API Changes: