Weird error happening randomly with Node client- Bad file descriptor as_socket_read_limit line 432


#1

Aerospike Version: Aerospike Community Edition build 3.6.3 We have a node server using Aerospike as DB. The load on the server is minimal. We have a monitoring service which monitors one of the API by repeatedly calling the API(once every minute). 99% of the time it works properly. However, once or twice a day, the get call from DB fails and we get following error: "{“code”:-1,“message”:“Bad file descriptor”,“func”:“as_socket_read_limit”,“file”:“src/main/aerospike/as_socket.c”,“line”:432}"

Kindly note that the Aerospike get query parameters remains the same in all those requests.

I have tried increasing the timeout to 800ms. var config = { hosts: settings.aerospike.hosts, policies : { key :aerospike.policy.key.SEND, timeout:800 } };

Also, have tried doubling proto-fd-max to 30000. Didn’t help :frowning:

This is not a major issue now. But in future when we have hundreds of request coming in every second, we may end up dropping requests. Thanks in advance


#2

What kind of call are you making? Do the server logs have anything in them?


#3

This error indicates that the server might have closed the socket connection. The server logs might contain a hint as to why that might have happened.

What client version are you using?


#4

Hi Albot,

Thanks a lot for your reply. The server log does not contains anything. We are making a get call. Here is the entire code

var aerospike = require(“aerospike”);

var client = aerospike.client(config);     client.connect(function (response) {      if ( response.code === 0) {          // handle success          console.log("\nConnection to Aerospike cluster succeeded!\n");      }      else {          // handle failure          console.log("\nConnection to Aerospike cluster failed!\n");          console.log(response);      } });

function getPersonList(group, cb){     var key = {ns : groupList.ns, set : groupList.set, key : group};     var udf = { module: HV_MODULE, funcname: “getids”};     client.execute(key, udf, function (err, result){         switch (err.code) {             case aerospike.status.AEROSPIKE_OK:                 cb(null, result);                 break;             default:                 cb({“type”: “internal_error”, “message”: JSON.stringify(err)});         }     }); }

Apologies for the delay in response.


#5

Hi Jan,

Thanks a lot for replying. Server logs does not have any error.

Client version: 1.0.57(according to History.md file)

Thanks in advance, Sanchit