Add a new class of chaos monkey errors after the inner code has run. Lower the overall error rate to reduce traffic.
This commit is contained in:
10
lib/utils.py
10
lib/utils.py
@@ -52,7 +52,15 @@ def chaos_monkey(handler):
|
||||
self.response.headers['Retry-After'] = '0'
|
||||
self.error(503)
|
||||
return
|
||||
return handler(self)
|
||||
|
||||
ret = handler(self)
|
||||
|
||||
if random.random() < config.CHAOS_PROBABILITY:
|
||||
self.response.headers['Retry-After'] = '0'
|
||||
self.error(503)
|
||||
return
|
||||
|
||||
return ret
|
||||
|
||||
return IntroduceFailures
|
||||
|
||||
|
||||
Reference in New Issue
Block a user