Questions tagged [distributed-lock]

53 questions
1
vote
2 answers

How to make a resource (screen) accessible to only one user at a time in a distributed .Net application?

I have a client server based windows forms application that needs an administrator only screen. The administrator functionality needs to be implemented in such a way that at any given time only one administrator can access that screen. The windows…
Ahmed Chaudhary
  • 189
  • 1
  • 9
0
votes
1 answer

time to live of DefaultLockRepository has no effect for 2 threads in the same java process when using JdbcLockRegistry

The following code can reproduce the issue https://github.com/cuipengfei/Spikes/blob/master/jpa/spring-jdbc-distributed-lock-issue/ run the test cases in the above code to reproduce before running the test case, start pg db in docker: docker run -e…
0
votes
0 answers

After redisson locks introduced, latency has increased substantially

I've introduced redisson lock recently, after that its taking 5-7s for. without lock it takes <1s. (testing locally in both cases). Im I doing anything wrong here. This is local figure, but in production too delay will be proportionally high with…
abhijeet104
  • 486
  • 4
  • 9
0
votes
0 answers

How to avoid race conditions in a distributed lock system using replicated redis clusters (or other replicated storage systems)?

We have identical services running on two Azure regional environments along with a redis system that is replicated/synchronised across the two regions. This is enterprise active-active replication. Entries may be placed into one redis instance and…
amkingTRP
  • 238
  • 4
  • 9
0
votes
0 answers

When we should prefer FencedLock over Lock in redisson?

When we should prefer FencedLock over Lock in redisson? Difference in documentation is not that vivid which could let you understand when to use which lock from these two.
Ash
  • 21
  • 6
0
votes
1 answer

Distributed lock using redisson- quorum configuration and selecting a new master node in case of old master failure

Distributed lock using redisson- Configure quorum configuration and acquiring lock from majority of nodes Configuration guide where can we find or some examples
Ash
  • 21
  • 6
0
votes
0 answers

Distributed lock & leader election -- how to ensure leader only does work when it holds lock?

When using a distributed lock library for example Consul to implement leader election ( there are 2 nodes consuming messages. However only 1 of them must acquire a lease on a distributed lock and become leader and actually process messages. The…
0
votes
1 answer

Consul: increment a counter in a KV atomically with multiple nodes

I'm using Consul for service discovery and the KV store, with more than 10 nodes. Let's say that each of these nodes has to increment a counter on the same KV, but has to do it atomically. The way I think this should work is the following (using 2…
boston
  • 95
  • 1
  • 7
0
votes
0 answers

ERR WAIT cannot be used with slave instances Redisson

3.16.3 readMode: SLAVE Not sure why am I seeing this error. caused by: org.redisson.client.RedisException: ERR WAIT cannot be used with slave instances. Please also note that since Redis 4.0 if a slave is…
Prashant
  • 37
  • 4
0
votes
1 answer

SQL Server : distributed locks how to check

I'm trying to figure out how to query SQL Server if there is a lock with give name, aka is there a lock. Is this correct, as it seems overly complicated? Running begin tran print 'APPLOCK_TEST=' + convert(varchar(max), APPLOCK_TEST('public',…
Seabizkit
  • 2,417
  • 2
  • 15
  • 32
0
votes
1 answer

Distrubuted lock with redisson throws exception

I am working on a microservice which reads data from devices via tcp socket. Micro service will also serve on different servers. Therefore, a distributed structure was designed. A RMapCache has been created on redis so that devices can be regularly…
0
votes
0 answers

SQL distributed lock not releasing on dispose

I am trying out distributed locks from DistributedLock nuget. Here's code snippet I use: class Program { private static SqlConnection _sqlConn = new SqlConnection("my connection string"); static void Main(string[] args) { int…
Michał Turczyn
  • 32,028
  • 14
  • 47
  • 69
0
votes
0 answers

.NET Core Difference between TransactionScope and DistributedLock

Good morning everyone, We are implementing a method that stores a document into SqlServer with EF Core. This method called SAVE is called by multiple endpoints of the controller and is used both from a createDocument endpoint and another endpoint…
0
votes
1 answer

Can I provide a custom FileLocker for a FileWritingMessageHandler?

I am using a FileReadingMessageSource with a custom FileLocker: @Component public class JdbcFileLocker implements FileLocker { ... @Autowired JdbcFileLocker jdbcFileLocker; @Bean @InboundChannelAdapter(value = "fileInputChannel", poller =…
0
votes
1 answer

How to use ShedLock in Spring Integration?

I am combining the Spring Batch and Spring Integration, I am using the poller with a corn: @Bean @SchedulerLock(name = "importEntitiesRiskCodes", lockAtMostForString = "PT5M") public IntegrationFlow integrationFlow() { return…