Appdynamics / Appdynamics/HA-toolkit

Hugepage detection is fragile and breaks when kernel doesn't support Hugepages

Open
#93 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
13
Forks
11
PR merge metrics
No merged PRs in 30d

Description

If kernel/OS does not support Hugepages, init.d/ startup script fails (regardless of support requested or not) (Test sample is Ubuntu 16.04 lxbrand on SmartOS)

```
ENABLE_HUGE_PAGES="false"
HUGE_PAGE_SIZE_BYTES=`awk '/Hugepagesize:/{print $2*1024}' /proc/meminfo`

if [ -f $APPD_ROOT/HA/LARGE_PAGES_ENABLE -a -n "$HUGE_PAGE_SIZE_BYTES" ] ; then
ENABLE_HUGE_PAGES="true"
fi
```

^^ HUGE_PAGE_SIZE_BYTES == null because value doesn't exist

Later: (line 1375) -> divide by zero:

` (( APPD_HUGE_PAGES = APPD_TOTAL_RESERVED_BYTES / HUGE_PAGE_SIZE_BYTES ))`

Output:

root@appd-node1:/# /etc/init.d/appdcontroller-db start
/etc/init.d/appdcontroller-db: line 1375: ((: APPD_HUGE_PAGES = APPD_TOTAL_RESERVED_BYTES / HUGE_PAGE_SIZE_BYTES : division by 0 (error token is "HUGE_PAGE_SIZE_BYTES ")
/etc/init.d/appdcontroller-db: line 1377: APPD_TOTAL_RESERVED_BYTES % HUGE_PAGE_SIZE_BYTES : division by 0 (error token is "HUGE_PAGE_SIZE_BYTES ")

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.