This is an automated email from the ASF dual-hosted git repository.
xiangfu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 9f5658439ca Allow semaphore with zero permit (#18074)
9f5658439ca is described below
commit 9f5658439caaf2d1d0ea26509ff5c1adb161f346
Author: Jhow <[email protected]>
AuthorDate: Wed Apr 1 19:52:54 2026 -0700
Allow semaphore with zero permit (#18074)
* allow semaphore with zero permit
* docs
Co-authored-by: Yash Mayya <[email protected]>
---------
Co-authored-by: Yash Mayya <[email protected]>
---
.../java/org/apache/pinot/common/concurrency/AdjustableSemaphore.java | 2 +-
.../apache/pinot/segment/local/utils/SegmentOperationsThrottler.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git
a/pinot-common/src/main/java/org/apache/pinot/common/concurrency/AdjustableSemaphore.java
b/pinot-common/src/main/java/org/apache/pinot/common/concurrency/AdjustableSemaphore.java
index adfde7f5faf..e88b8714b09 100644
---
a/pinot-common/src/main/java/org/apache/pinot/common/concurrency/AdjustableSemaphore.java
+++
b/pinot-common/src/main/java/org/apache/pinot/common/concurrency/AdjustableSemaphore.java
@@ -44,7 +44,7 @@ public class AdjustableSemaphore extends Semaphore {
* Synchronized to allow multiple threads to update permits concurrently
*/
public synchronized void setPermits(int permits) {
- Preconditions.checkArgument(permits > 0, "Permits must be a positive
integer");
+ Preconditions.checkArgument(permits >= 0, "Permits must be a non-negative
integer");
if (permits < _totalPermits) {
reducePermits(_totalPermits - permits);
} else if (permits > _totalPermits) {
diff --git
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/SegmentOperationsThrottler.java
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/SegmentOperationsThrottler.java
index 219537ac92c..fac1216f4b6 100644
---
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/SegmentOperationsThrottler.java
+++
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/SegmentOperationsThrottler.java
@@ -91,7 +91,7 @@ public class SegmentOperationsThrottler {
_throttlerName = throttlerName;
_thresholdGauge = thresholdGauge;
_countGauge = countGauge;
- LOGGER.info("Initializing SegmentOperationsThrottlerSet {},
maxConcurrency: {}, "
+ LOGGER.info("Initializing SegmentOperationsThrottler {}, maxConcurrency:
{}, "
+ "maxConcurrencyBeforeServingQueries: {}, isServingQueries: {}",
throttlerName, maxConcurrency, maxConcurrencyBeforeServingQueries,
isServingQueries);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]