RExecutorService.countActiveWorkers hangs if there no registered workers. #1387

pull/1423/head
Nikita 7 years ago
parent 5f4a298872
commit b0aa6e7201

@ -199,6 +199,10 @@ public class RedissonExecutorService implements RScheduledExecutorService {
public int countActiveWorkers() {
String id = generateRequestId();
int subscribers = (int) workersTopic.publish(id);
if (subscribers == 0) {
return 0;
}
RSemaphore semaphore = redisson.getSemaphore(workersSemaphoreName + ":" + id);
try {
semaphore.tryAcquire(subscribers, 10, TimeUnit.MINUTES);

Loading…
Cancel
Save