Skip to content

Commit 05bc8d5

Browse files
testing removal of redundant call to startPolling
1 parent 856be12 commit 05bc8d5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎conductor-client/src/main/java/com/netflix/conductor/sdk/workflow/executor/task/AnnotatedWorkerExecutor.java‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ public AnnotatedWorkerExecutor(TaskClient taskClient, WorkerConfiguration worker
7676
* implementation
7777
*/
7878
public synchronized void initWorkers(String... basePackages) {
79+
// scanWorkers() -> initWorkersFromClasses() -> initWorkersFromInstances() already calls startPolling();
80+
// an extra call here used to race with that one and could drop a task polled by the runner it replaces.
7981
scanWorkers(basePackages);
80-
startPolling();
8182
}
8283

8384
public synchronized void initWorkersFromInstances(List<Object> workerInstances) {
@@ -157,7 +158,10 @@ private void scanWorkers(String... basePackages) {
157158
initWorkersFromClasses(classes);
158159

159160
} catch (Exception e) {
160-
LOGGER.error("Error while scanning for workers: ", e);
161+
// Rethrow (unchecked) rather than swallow: initWorkers() no longer has its own startPolling()
162+
// fallback, so a swallowed failure here would otherwise leave the caller believing workers are
163+
// running when none were ever started.
164+
throw new RuntimeException("Error while scanning for workers", e);
161165
}
162166
}
163167

0 commit comments

Comments
 (0)