candi icon indicating copy to clipboard operation
candi copied to clipboard

Locker/timeout (Deadlocks Guard)

Open wuriyanto48 opened this issue 2 years ago • 1 comments

This pull request aims to fulfill the rules of the distributed lock,

  • in a distributed key, each entity (instance/pod) that creates the key is responsible for deleting the key
  • what happens if the entity(instance/pods) that created that lock restarts or dies suddenly?

by adding a timeout to each key locker that is made the possibility of deadlocks can be minimized. Assuming the tolerance for each function, code section, or external service call is under 10 seconds. According to the LOCKER_TIMEOUT configuration in the env variable

the rest is open for discussion cc: @agungdwiprasetyo

wuriyanto48 avatar Mar 16 '22 05:03 wuriyanto48

Codecov Report

Merging #17 (a3ac147) into master (f8062ef) will decrease coverage by 0.17%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
- Coverage   23.63%   23.45%   -0.18%     
==========================================
  Files          41       41              
  Lines        2124     2140      +16     
==========================================
  Hits          502      502              
- Misses       1603     1619      +16     
  Partials       19       19              
Impacted Files Coverage Δ
candiutils/locker.go 0.00% <0.00%> (ø)
config/env/environment.go 2.15% <0.00%> (-0.03%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f8062ef...a3ac147. Read the comment docs.

codecov-commenter avatar Mar 16 '22 05:03 codecov-commenter