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

Make Aerospike connection idle timeout configurable #118

Merged
merged 4 commits into from
Nov 10, 2022

Conversation

guscarreon
Copy link
Contributor

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.

Password string `mapstructure:"password"`
MaxReadRetries int `mapstructure:"max_read_retries"`
MaxWriteRetries int `mapstructure:"max_write_retries"`
ConnectionIdleTimeout int `mapstructure:"connection_idle_timeout"`
Copy link
Contributor

@mansinahar mansinahar Nov 8, 2022

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.

Copy link
Contributor Author

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

}

if cfg.ConnectionIdleTimeout > 0 {
log.Infof("config.backend.aerospike.connection_idle_timeout: %d. Will substitute Aerospike's default 55 seconds.", cfg.ConnectionIdleTimeout)
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Corrected

mansinahar
mansinahar previously approved these changes Nov 8, 2022
AlexBVolcy
AlexBVolcy previously approved these changes Nov 9, 2022
@guscarreon guscarreon dismissed stale reviews from AlexBVolcy and mansinahar via 97b5006 November 9, 2022 19:39
@guscarreon guscarreon merged commit 67b91e5 into prebid:master Nov 10, 2022
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.

3 participants