# ACK Timeout / Session Timeout

**URL:** <https://forum.genieacs.com/t/ack-timeout-session-timeout/38>\
**Category:** Uncategorized\
**Created:** [January 29, 2019, 4:23pm UTC](https://forum.genieacs.com/t/ack-timeout-session-timeout/38 "2019-01-29T16:23:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malto4](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/malto4/32/144_2.png) [@Malto4](https://forum.genieacs.com/u/Malto4)\
**Post date:** [January 29, 2019, 4:24pm UTC](https://forum.genieacs.com/t/ack-timeout-session-timeout/38/1 "2019-01-29T16:24:00Z")

</div>

Hello,

We have recently been trying to get our ACS working with NuCom routers ([https://nucom.es/](https://nucom.es/)) and have been having some trouble with timeouts.

We decided to Port Mirror the WAN Ethernet so that we could see how the connection between the ACS and Router looked.

![image](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/genieacs/original/1X/d7a7a8b8b4e783f620db2d57c28779674f958781.png)

The router would get to a point in our provisioning script but would then seem to just stop responding. After checking the wireshark capture we saw that there was a time when the Router stopped sending packets for 5 seconds but then started again. It seems that the ACS, after seeing that the router hadn’t sent any packets duirng these 5 seconds decided that the comunication with the router had finished. This then causes a timeout in the cwmp-access log.

I have tried looking at the General Config Page ([https://github.com/genieacs/genieacs/wiki/GenieACS-General-Config](https://github.com/genieacs/genieacs/wiki/GenieACS-General-Config)) and the config.coffee files to see if there was any sign of a “after 5 seconds kill connection” like code, but I haven’t managed to see anything.

Does anyone know why this might be happening and how I can fix it?

Thanks,  
James

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [January 29, 2019, 11:14pm UTC](https://forum.genieacs.com/t/ack-timeout-session-timeout/38/2 "2019-01-29T23:14:50Z")

</div>

This is because of the keep-alive timeout which is 5 seconds. This shouldn’t be an issue if you go by the spec. The CPE should initiate a new TCP connection to continue the session.

See: [https://nodejs.org/api/http.html#http\_server\_keepalivetimeout](https://nodejs.org/api/http.html#http_server_keepalivetimeout)

Patch lib/server.coffee and see if that helps. I can add a config option to override the default keep-alive timeout.

---

<div class="post-metadata">

**Author:** ![Malto4](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/malto4/32/144_2.png) [@Malto4](https://forum.genieacs.com/u/Malto4)\
**Post date:** [January 30, 2019, 8:21am UTC](https://forum.genieacs.com/t/ack-timeout-session-timeout/38/3 "2019-01-30T08:21:24Z")

</div>

Hi Zaid,

Thanks for the quick reply. The way I have done it is editting lib/server.coffee:

> ```
> setTimeout(() ->
> return if not callback
> 
> # Ignore HTTP requests from connection that may still be open
> server.removeListener('request', listener)
> server.setTimeout(1)
> server.keepAliveTimeout(10000)
> 
> cb = callback
> callback = null
> setTimeout(cb, 1000)
> 
> ```

Could you confirm that this is the way to do it?

Thank you,  
James

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [January 31, 2019, 5:06am UTC](https://forum.genieacs.com/t/ack-timeout-session-timeout/38/4 "2019-01-31T05:06:48Z")

</div>

Not quite. Add the following line:

```
server.keepAliveTimeout = 10000

```

Just before line starting with “server.listen(…”

---

<div class="post-metadata">

**Author:** ![Malto4](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/malto4/32/144_2.png) [@Malto4](https://forum.genieacs.com/u/Malto4)\
**Post date:** [January 31, 2019, 8:00am UTC](https://forum.genieacs.com/t/ack-timeout-session-timeout/38/5 "2019-01-31T08:00:46Z")

</div>

Thanks Zaid,

With that it is now working 😀

Although, instead of lib/server.coffee we had to patch server.js

```
db.connect(function(err) {
  if (err) {
    throw err;
  }
  return cache.connect(function(err) {
    if (err) {
      throw err;
    }
    server.keepAliveTimeout = 10000;
    return server.listen(port, networkInterface);
  });
});

```

Thank you very much for your quick response.

James
