Coder Social home page Coder Social logo

Comments (4)

BrianNichols avatar BrianNichols commented on June 11, 2024

Are you using enterprise server with user/password authentication enabled?

If so, the authentication portion is indeed using the connection timeout (default 1 second) and not the transaction timeout. The temporary workaround is to set the connection timeout at startup:

as_config cfg;
as_config_init(&cfg);
cfg.conn_timeout_ms = 900000;
aerospike_init(client, &cfg);
aerospike_connect(client, &err);

from aerospike-client-c.

tnozicka avatar tnozicka commented on June 11, 2024

We are using community edition for now.
Just for my test case I have also set the following, but nothing seems to affect the real timeout.

as_config config;
as_config_init(&config);
as_config_add_host(&config, "<my_host_1>", 3000);
as_config_add_host(&config, "<my_host_2>", 3000);
config.conn_timeout_ms = 3000000;
config.policies.timeout = 200000;
config.policies.operate.retry = AS_POLICY_RETRY_ONCE;
config.policies.operate.timeout = 600000;
config.policies.info.timeout = 400000;
config.policies.read.timeout = 700000;
config.policies.remove.timeout = 800000;

It still fails with connection timeout after 1 sec.

from aerospike-client-c.

BrianNichols avatar BrianNichols commented on June 11, 2024

You have identified a bug, but it's not the one you think. AS_POLICY_RETRY_ONCE was specified, but the client retried twice after the initial failure. This will be fixed in the next release.

Timeouts can occur for the following reasons:

  1. Client can't connect by specified timeout.
  2. Client does not receive response by specified timeout.
  3. Server times out the transaction during it's own processing.
  4. Client can't obtain a valid node after N retries.
  5. Client can't obtain a valid connection after N retries. The retry count is usually the limiting factor, not the timeout value. The reasoning is that if you can't get a connection after N retries, you never will, so just timeout early.

Your application is timing out because of #5. The reason is that Aerospike server probably ran out of sockets. Socket limit is controlled by OS settings (Linux = ulimit -n). Aerospike Server service config also further limits socket count with "proto-fd-max ".

The retry policy is an enum, but it can be overloaded to be an integer. The following would retry up to 100 times.

policy.retry = 100;

We will also make retry an integer in the next release which will still be backwards compatible.

from aerospike-client-c.

BrianNichols avatar BrianNichols commented on June 11, 2024

Version 3.1.19 has been released.

from aerospike-client-c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.