Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndb_redis: add disable server on failure feature #1116

Merged
merged 2 commits into from May 5, 2017

Conversation

claudiupb
Copy link

Hello,

We added a new feature to the ndb_redis module, similar to how the rtpengine_disable_tout parameter of the rtpengine module works.

If a number of consecutive commands to a redis server fail, that server is temporarily disabled. This is configurable by parameters: "allowed_timeouts" and "disable_time".
Disabling a server means that for "disable_time" seconds any command to that sever will not send the command to the server, but an error is returned instead.

For example if allowed_timeouts is configured to 0 and disable_time to 30, the first time redis_cmd or redis_execute functions fail the server will be disabled for 30 seconds.

The server information is retained by each Kamailio process individually, so this means that disabling a server is done by that process only and not globally.

  - if a server fails multiple consecutive times
    it is disabled temporarily and commands to it
    will not do anything.
@miconda
Copy link
Member

miconda commented May 4, 2017

I am ok to merge this PR, but you have to follow up with another patch to rename the global variables for the module parameters added in this PR to have redis_ as a prefix, like for the other existing parameters. It is good in long term as it avoids collisions with other variables that could have same name with these common words.

@claudiupb
Copy link
Author

I have changed the names of the variables adding the redis_ prefix and _param suffix

@miconda
Copy link
Member

miconda commented May 5, 2017

Thanks!

@miconda miconda merged commit c55ad4e into kamailio:master May 5, 2017
@claudiupb claudiupb deleted the redis_disable_server branch May 10, 2017 07:44
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.

None yet

2 participants