简体   繁体   English

ArangoDB游标超时

[英]ArangoDB Cursor Timeout

Using ArangoDB 2.3.1. 使用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: 我已经使用TTL参数设置了我的AQL查询对象,如下所示:

{
    "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. 我的理解是TTL参数应该告诉服务器将服务器保持3600000毫秒或1小时。 But it expires within about 60 seconds. 但它会在约60秒内过期。 In fact, I've tried changing the TTL to several different numbers and it doesn't seem to do anything. 实际上,我已经尝试将TTL更改为几个不同的数字,并且它似乎没有任何作用。 Any ideas? 有任何想法吗?

UPDATE: the actual error I receive from arango is "cursor not found" 更新:我从arango收到的实际错误是“找不到光标”

All of you are right. 你们所有人都是对的。 But I think it is a bug in 2.3: 但我认为这是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. ttl是双精度型 ,因此应将其强制转换为双精度型,而不是布尔型。 Unfortunately, assigning a bool to a double is valid in C++ so the compiler hasn't complained. 不幸的是,将布尔值分配给double在C ++中是有效的,因此编译器没有抱怨。

Have you tried using the timeout directive? 您是否尝试过使用timeout指令?

--server.keep-alive-timeout=X

Where X is in seconds. X以秒为单位。

Or you can insert this into your arangod.conf file under the server section as 或者,您可以将其插入到服务器部分下的arangod.conf文件中,如下所示:

keep-alive-timout=X

According to the manual 根据手册

Allows to specify the timout for HTTP keep-alive connections. 允许为HTTP保持活动连接指定超时。 The timeout value must be in seconds. 超时值必须以秒为单位。 Idle keep-alive connections will be closed by the server automatically when the timeout is reached. 达到超时时,服务器将自动关闭空闲的保持活动连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM