-
Notifications
You must be signed in to change notification settings - Fork 62
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
Make Aerospike connection idle timeout configurable #118
Conversation
config/backends.go
Outdated
Password string `mapstructure:"password"` | ||
MaxReadRetries int `mapstructure:"max_read_retries"` | ||
MaxWriteRetries int `mapstructure:"max_write_retries"` | ||
ConnectionIdleTimeout int `mapstructure:"connection_idle_timeout"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guscarreon Can we rename this to be connection_idle_timeout_sec
to be clear about the time unit? Also, can you please add a comment for this config field along the lines of:
// Please set this to a value lower than the `proto-fd-idle-ms` (converted to seconds) value set in your Aerospike Server.
// This is to avoid having race conditions where the server closes the connection but the client still tries to use it.
// If set to a value less than or equal to 0, Aerospike Client's default value will be used which is 55 seconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Great comment wording. Modified
config/backends.go
Outdated
} | ||
|
||
if cfg.ConnectionIdleTimeout > 0 { | ||
log.Infof("config.backend.aerospike.connection_idle_timeout: %d. Will substitute Aerospike's default 55 seconds.", cfg.ConnectionIdleTimeout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we can skip this part of the log message: Will substitute Aerospike's default 55 seconds.
as when someone's overriding that value, the value they have set is what we should log. Logging the default value that it will substitute won't help much IMHO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected
97b5006
One of the Aerospike's client policy parameters is the maximum idle timeout for a connection. This pull requests makes Prebid Cache to be able to configure said paramenter.