Skip to content

Conversation

@RomuloOliveira
Copy link
Contributor

This is to mitigate the consequences from a key that may be created without timeout. It may occur when a key expires AFTER the add call and it's created in the incr, therefore without timeout.

@codecov-io
Copy link

codecov-io commented Aug 23, 2017

Codecov Report

Merging #27 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #27   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          11     11           
  Lines         153    154    +1     
=====================================
+ Hits          153    154    +1
Impacted Files Coverage Δ
django_toolkit/fallbacks/circuit_breaker.py 100% <100%> (ø) ⬆️

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 145cc75...21f5615. Read the comment docs.


def _increase_failure_count(self):
# Between the cache.add and cache.incr, the cache MAY expire,
# which will led to a circuit that will eventually open
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it ...will lead instead of will led?

Copy link
Contributor

@renanivo renanivo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 Great!

This is to mitigate the consequences from a key that
may be created without timeout.

It may occur when a key expires AFTER the
`add` call and it's created in the `incr`,
therefore without timeout.
@RomuloOliveira RomuloOliveira force-pushed the ro-circuit_breaker_race_condition-fix branch from ddc352e to 21f5615 Compare August 23, 2017 19:14
@RomuloOliveira RomuloOliveira merged commit 3d983bb into master Aug 23, 2017
@RomuloOliveira RomuloOliveira deleted the ro-circuit_breaker_race_condition-fix branch August 23, 2017 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants