keith-turner commented on code in PR #2609:
URL: https://github.com/apache/accumulo/pull/2609#discussion_r846566525
##########
server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java:
##########
@@ -394,6 +398,20 @@ private static long jitter() {
* TabletServer.TIME_BETWEEN_LOCATOR_CACHE_CLEARS);
}
+ public Semaphore getSemaphore() {
+ int writeThreads =
+
getServerConfig().getConfiguration().getCount(Property.TSERV_MAX_WRITETHREADS);
+ if (writeThreads == 0)
+ writeThreads = Integer.MAX_VALUE;
+ if (sem == null || maxThreadPermits != writeThreads) {
Review Comment:
sem and maxThreadPermits are read outside sync, should probably be volatile.
Also the checks should be done again inside the sync block, because multiple
threads could execute the if and get a true value and then block on the sync
block.
--
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]