Under high load, the value returned by `shm_available()` can be total garbage, 
because it is not multiprocess safe. In the tls module, it makes the tests 
against the `low_mem_thresholdX` limits randomly return false positives, with 
errors such as:
```
ERROR: tls [tls_server.c:273]: tls_fix_connection(): tls: ssl bug #1491 
workaround: not enough memory for safe operation: 88
```
although there is plenty of free shm memory.
 
This patch solves the issue by adding a safe version of the function.
You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/126

-- Commit Summary --

  * mem: add a multiprocess-safe shm_available()
  * tls: use multiprocess-safe shm_available()

-- File Changes --

    M mem/shm_mem.c (8)
    M mem/shm_mem.h (5)
    M modules/tls/tls_server.c (4)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/126.patch
https://github.com/kamailio/kamailio/pull/126.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/126
_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to