apache / apache/curator

[CURATOR-230] Get remaining semaphore count upon lease acquisition

Open
#750 0 comments 0 reactions 0 assignees View on GitHub
imported-jira-issue
Dominant language
Java
Stars
3.2k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I'm using Curator to help generate IDs in a distributed environment. My IDs are pretty typical: 64 bits with three components: timestamp, worker, count. The worker component comes from a Curator DistributedAtomicNumber modulo the max number of workers. To make sure that at any given time the number of workers don't exceed the max number of workers, each worker needs to take an InterProcessSemaphoreV2 before it gets its worker ID. There are some inherent issues with this method, but it's serving me fine at the moment. However, it seems that this use-case could be made entirely much simpler if I could just get a lease count upon acquiring an InterProcessSemaphoreV2. Would this be possible? Thank you.

---
Originally reported by dminkovsky, imported from: Get remaining semaphore count upon lease acquisition


  • status: Open
  • priority: Trivial
  • resolution: Unresolved
  • imported: 2025-01-21

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.