anmolnar commented on code in PR #1961:
URL: https://github.com/apache/zookeeper/pull/1961#discussion_r1066055084
##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java:
##########
@@ -1151,6 +1213,9 @@ protected void setLocalSessionFlag(Request si) {
}
public void submitRequest(Request si) {
+ if (state == State.MAINTENANCE) {
+ throw new IllegalStateException("Zookeeper server is in
maintenance state");
+ }
Review Comment:
Yeah, be aware that you have to do `notifyAll()` after changing the state
back to RUNNING to notify the waiting threads. I'll add another comment at the
right place.
Additionally, I don't get this `check-wait(timeout)-check-wait(timeout)-...`
logic. It doesn't make sense to me, there's no additional fail-safe logic
inside the loop, why don't just `wait()`?
Instead, it takes back the lock in every second probably without any
benefit. I don't say we have to change that, I just don't understand.
--
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]