| 5111 | } |
| 5112 | |
| 5113 | void sentinelTimer(void) { |
| 5114 | sentinelCheckTiltCondition(); |
| 5115 | sentinelHandleDictOfRedisInstances(sentinel.masters); |
| 5116 | sentinelRunPendingScripts(); |
| 5117 | sentinelCollectTerminatedScripts(); |
| 5118 | sentinelKillTimedoutScripts(); |
| 5119 | |
| 5120 | /* We continuously change the frequency of the Redis "timer interrupt" |
| 5121 | * in order to desynchronize every Sentinel from every other. |
| 5122 | * This non-determinism avoids that Sentinels started at the same time |
| 5123 | * exactly continue to stay synchronized asking to be voted at the |
| 5124 | * same time again and again (resulting in nobody likely winning the |
| 5125 | * election because of split brain voting). */ |
| 5126 | g_pserver->hz = CONFIG_DEFAULT_HZ + rand() % CONFIG_DEFAULT_HZ; |
| 5127 | } |
no test coverage detected