2

Using ArangoDB 2.3.1. It seems my cursors are expiring within a couple minutes. I would like them to last for an hour. I've set up my AQL query object with the TTL parameter as follows:

{
    "query": 'removed actual query',
    "count": true,
    "batchSize": 5,
    "ttl": 3600000
}

My understanding is that the TTL parameter should tell the server to keep the server for 3600000 milliseconds or 1 hour. But it expires within about 60 seconds. In fact, I've tried changing the TTL to several different numbers and it doesn't seem to do anything. Any ideas?

UPDATE: the actual error I receive from arango is "cursor not found"

skinneejoe
  • 3,921
  • 5
  • 30
  • 45
  • According to the manual, the TTL for cursors is in seconds, not milliseconds. – Jerry Saravia Dec 05 '14 at 02:23
  • The TTL should keep the cursor alive for you to call later. The ttl won't make a difference if the connection is timing out. – Jerry Saravia Dec 05 '14 at 02:26
  • The actual error from Arango is "cursor not found" so I assume that means the cursor is timing out and no longer available. Any ideas how I can extend this timeout? – skinneejoe Dec 05 '14 at 15:49

3 Answers3

4

All of you are right. But I think it is a bug in 2.3:

--- a/arangod/V8Server/v8-vocbase.cpp
+++ b/arangod/V8Server/v8-vocbase.cpp
@@ -1216,13 +1216,13 @@ static v8::Handle<v8::Value> JS_ExecuteAql (v8::Arguments const& argv) {

     optionName = v8::String::New("ttl");
     if (argValue->Has(optionName)) {
-      ttl = TRI_ObjectToBoolean(argValue->Get(optionName));
+      ttl = TRI_ObjectToDouble(argValue->Get(optionName));
       ttl = (ttl <= 0.0 ? 30.0 : ttl);
     }

ttl is a double and so it should be casted to a double, not a bool. Unfortunately, assigning a bool to a double is valid in C++ so the compiler hasn't complained.

stj
  • 9,037
  • 19
  • 33
  • 1
    Fix will be shipped with 2.3.2 – stj Dec 05 '14 at 08:19
  • Any thoughts on how I can solve or work around this issue prior to 2.3.2? Thanks! – skinneejoe Dec 05 '14 at 15:50
  • The only way to get it into a pre-2.3.2 is to fix the source code at the position above and re-compile. However, 2.3.2 should be available soon (next week). – stj Dec 05 '14 at 17:40
  • Is there a way to change the ttl time on for the whole database, rather than just per call? The keep-alive-timeout setting in the .conf file didn't seem to work for me. – skinneejoe Dec 05 '14 at 18:32
0

Have you tried using the timeout directive?

--server.keep-alive-timeout=X

Where X is in seconds.

Or you can insert this into your arangod.conf file under the server section as

keep-alive-timout=X

According to the manual

Allows to specify the timout for HTTP keep-alive connections. The timeout value must be in seconds. Idle keep-alive connections will be closed by the server automatically when the timeout is reached.

Jerry Saravia
  • 3,737
  • 3
  • 24
  • 39
0

[I had this same question but server-wide, and it was hard for me to find the answer, and this question came up near the top in searches, so I'm documenting here for posterity.]

The server-wide setting is query.registry-ttl, as per https://www.arangodb.com/docs/stable/programs-arangod-options.html and you can get the current server settings with

To list the configuration options of a running arangod instance, you can connect with an ArangoShell and invoke a Transaction by calling db._executeTransaction() and providing a JavaScript function to retrieve the server options:

arangosh> db._executeTransaction({ collections: {}, action: function() {return require("internal").options();} })

as per https://www.arangodb.com/docs/stable/administration-configuration.html#ex-listCurrentConfigOpts