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

[CLIENT-2093] Add more input validation in client config and partition filter dictionaries #582

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
30 changes: 17 additions & 13 deletions doc/aerospike.rst
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ Only the `hosts` key is required; the rest of the keys are optional.

Default: :data:`aerospike.AUTH_INTERNAL`
* **login_timeout_ms** (:class:`int`)
Representing the node login timeout in milliseconds.
Representing the node login timeout in milliseconds. (32-bit unsigned integer)

Default: ``5000``.
* **key**
Expand Down Expand Up @@ -471,19 +471,19 @@ Only the `hosts` key is required; the rest of the keys are optional.
If multiple clients are instantiated and talking to the same cluster the *shm* cluster-tending should be used.

* **max_nodes** (:class:`int`)
Maximum number of nodes allowed.
Maximum number of nodes allowed. (32-bit unsigned integer)

Pad this value so new nodes can be added without configuration changes.

Default: ``16``
* **max_namespaces** (:class:`int`)
Maximum number of namespaces allowed.
Maximum number of namespaces allowed. (32-bit unsigned integer)

Pad this value so new namespaces can be added without configuration changes.

Default: ``8``
* **takeover_threshold_sec** (:class:`int`)
Take over tending if the cluster hasn't been checked for this many seconds
Take over tending if the cluster hasn't been checked for this many seconds (32-bit unsigned integer)

Default: ``30``
* **shm_key**
Expand Down Expand Up @@ -584,11 +584,12 @@ Only the `hosts` key is required; the rest of the keys are optional.

Takes precedence over a class serializer registered with :func:`~aerospike.set_serializer`.
* **thread_pool_size** (:class:`int`)
Number of threads in the pool that is used in batch/scan/query commands.
Number of threads in the pool that is used in batch/scan/query commands. (32-bit unsigned integer)

Default: ``16``
* **max_socket_idle** (:class:`int`)
Maximum socket idle in seconds. Connection pools will discard sockets that have been idle longer than the maximum.
Maximum socket idle in seconds.
Connection pools will discard sockets that have been idle longer than the maximum.

Connection pools are now implemented by a LIFO stack.
Connections at the tail of the stack will always be the least used.
Expand All @@ -606,7 +607,7 @@ Only the `hosts` key is required; the rest of the keys are optional.
Default: ``0``

* **min_conns_per_node** (:class:`int`)
Minimum number of synchronous connections allowed per server node. Preallocate minimum
Minimum number of synchronous connections allowed per server node. (32-bit unsigned integer) Preallocate minimum
connections on client node creation. The client will periodically allocate new connections
if count falls below min connections.

Expand All @@ -616,29 +617,31 @@ Only the `hosts` key is required; the rest of the keys are optional.

Default: ``0``
* **max_conns_per_node** (:class:`int`)
Maximum number of pipeline connections allowed for each node
Maximum number of pipeline connections allowed for each node (32-bit unsigned integer)

Default: ``100``
* **max_error_rate** (:class:`int`)
Maximum number of errors allowed per node per ``error_rate_window`` before backoff algorithm returns :exc:`~aerospike.exception.MaxErrorRateExceeded` for database commands to that node. If ``max_error_rate`` is zero, there is no error limit.
Maximum number of errors allowed per node per ``error_rate_window`` before backoff algorithm returns :exc:`~aerospike.exception.MaxErrorRateExceeded` for database commands to that node. (32-bit unsigned integer)
If ``max_error_rate`` is zero, there is no error limit.

The counted error types are any error that causes the connection to close (socket errors and client timeouts), server device overload and server timeouts.

The application should backoff or reduce the transaction load until :exc:`~aerospike.exception.MaxErrorRateExceeded` stops being returned.

Default: ``100``
* **error_rate_window** (:class:`int`)
The number of cluster tend iterations that defines the window for ``max_error_rate``. One tend iteration is defined as ``tend_interval`` plus the time to tend all nodes. At the end of the window, the error count is reset to zero and backoff state is removed on all nodes.
The number of cluster tend iterations that defines the window for ``max_error_rate``. (32-bit unsigned integer)
One tend iteration is defined as ``tend_interval`` plus the time to tend all nodes. At the end of the window, the error count is reset to zero and backoff state is removed on all nodes.

Default: ``1``
* **tend_interval** (:class:`int`)
Polling interval in milliseconds for tending the cluster
Polling interval in milliseconds for tending the cluster. (32-bit unsigned integer)

Default: ``1000``
* **compression_threshold** (:class:`int`)
**Deprecated**: set in the :ref:`aerospike_write_policies` dictionary

Compress data for transmission if the object size is greater than a given number of bytes
Compress data for transmission if the object size is greater than a given number of bytes. (32-bit unsigned integer)

Default: ``0``, meaning 'never compress'
* **cluster_name** (:class:`str`)
Expand Down Expand Up @@ -675,7 +678,8 @@ Only the `hosts` key is required; the rest of the keys are optional.

Default: ``False``
* **connect_timeout** (:class:`int`)
Initial host connection timeout in milliseconds. The timeout when opening a connection to the server host for the first time.
Initial host connection timeout in milliseconds. (32-bit unsigned integer)
The timeout when opening a connection to the server host for the first time.

Default: ``1000``.
* **fail_if_not_connected** (:class:`bool`)
Expand Down
1 change: 1 addition & 0 deletions src/include/policy_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ as_status set_batch_write_policy(as_policy_batch_write *batch_write_policy,
PyObject *py_policy);
as_status set_batch_remove_policy(as_policy_batch_remove *batch_remove_policy,
PyObject *py_policy);
as_status get_uint32_value(PyObject *py_policy_val, uint32_t *return_uint32);
7 changes: 6 additions & 1 deletion src/include/tls_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@

#include "macros.h"

void setup_tls_config(as_config *config, PyObject *tls_config);
typedef struct {
char *tls_key;
char *expected_type;
} as_error_type_info;

as_error_type_info *setup_tls_config(as_config *config, PyObject *tls_config);
Loading
Loading