Apache9 commented on code in PR #4577:
URL: https://github.com/apache/hbase/pull/4577#discussion_r908141198
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/WorkerAssigner.java:
##########
@@ -60,27 +59,23 @@ public synchronized Optional<ServerName> acquire() {
.findAny();
worker.ifPresent(name -> currentWorkers.compute(name, (serverName,
availableWorker) -> availableWorker == null ? maxTasks - 1 :
availableWorker - 1));
+ event.suspend();
Review Comment:
Should only suspend the procedure when there is no worker available? And I
think here we could make the return value as ServerName instead of
Optional<ServerName>, and throw ProcedureSuspendedException directly if worker
is not available.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]