Whether it is necessary to set values LockAtMostFor and LockAtMostFor for a task that is executed once a month, the execution time is several minutes, there are several nodes with a running service. How correct will it be to expose values to
lockAtLeastFor = "PT1H" lockAtMostFor = "15m"
?
Asked
Active
Viewed 2,989 times
0

sdkdan
- 13
- 2
- 5
2 Answers
0
If you want the task to be run by only one node then it is necessary to add lockAtLeastFor and lockAtMostFor .
lockAtLeastFor : Should be the value taken by your task to get completed.
lockAtMostFor : should be lockAtLeastFor + some buffer time .
if lockAtLeastFor is too small then the same task can be picked up by other node.(Job will run in multiple nodes not in one node)
if lockAtMostFor is not set or set to high value and your node dies after acquiring the lock
No other node can acquire the lock.

sadath pasha
- 49
- 11
0
You do not have to set lockAtLeastFor
. On the other hand lockAtMostFor
has to be set just in case the node executing the taks dies. The lock gets automatically released after that time.

Lukas
- 13,606
- 9
- 31
- 40
-
Let´s say, the lockAtMostFor set for 1 hour or 15 minutes, if the node dies, will task be executed? The task is scheduled for execution on the first day of each month – sdkdan May 30 '21 at 12:21