srkukarni commented on a change in pull request #7237:
URL: https://github.com/apache/pulsar/pull/7237#discussion_r439175663



##########
File path: 
pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/SchedulerManager.java
##########
@@ -137,25 +165,35 @@ public SchedulerManager(WorkerConfig workerConfig, 
PulsarClient pulsarClient, Pu
     }
 
     public Future<?> schedule() {
-        return executorService.submit(() -> {
-            synchronized (SchedulerManager.this) {
-                boolean isLeader = membershipManager.isLeader();
-                if (isLeader) {
-                    try {
-                        invokeScheduler();
-                    } catch (Exception e) {
-                        log.warn("Failed to invoke scheduler", e);
-                        throw e;
+        try {

Review comment:
       I think we need to simplify this massively.
   I think part of the pr that I'm working on wrt metadata simplification will 
impact this as well.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to