markusthoemmes commented on a change in pull request #3656: Adjust the
ForcibleSemaphore mechanism
URL:
https://github.com/apache/incubator-openwhisk/pull/3656#discussion_r189794283
##########
File path: common/scala/src/main/scala/whisk/common/ForcableSemaphore.scala
##########
@@ -82,6 +85,21 @@ class ForcableSemaphore(maxAllowed: Int) {
forceAquireShared(acquires)
}
}
+
+ /**
+ * when the cluster of controllers is changed, the new state should be set
to
+ * newMaxAllowed - (oldMaxAllowed - oldState)
+ * e.g. before change, the maxAllowed = 10, and state = 8, which means
there are 2 acquired shared, after change to
+ * the newMaxAllowed = 5, the acquired shared cannot be changed manually,
we need set the new state to 5 - (10 - 8)
+ */
Review comment:
Please generalize the Scaladoc. The semaphore isn't necessarily specific to
a cluster of controllers.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services