See libnuma commit
0ab9c7a0d857bea1724139c48e2e58ed6a81647f:
commit
0ab9c7a0d857bea1724139c48e2e58ed6a81647f
Author: filimonov <
1549571+filimonov@users.noreply.github.com>
Date: Mon Oct 21 18:45:02 2024 +0200
Make numa_available respect EPERM
Make numa_available respect EPERM
In the Docker environment, usage of `get_mempolicy` is restricted by seccomp security profiles:
https://docs.docker.com/engine/security/seccomp/ (unless `CAP_SYS_NICE` is set).
But `numa_available` used to ignore EPERM and return 'true', i.e., available. This led to further code attempting other API calls, which resulted in "operation not permitted" errors printed to stderr.
See details in:
https://github.com/ClickHouse/ClickHouse/issues/68747#issuecomment-
2426210768
Change-Id: I5169f54ac7622754e33e7c67ee1d813876de44b9
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
int ret;
ret = get_mempolicy(NULL, NULL, 0, NULL, 0);
- if (ret && errno == ENOSYS) {
+ if (ret && (errno == ENOSYS || errno == EPERM)) {
return false;
}
return numa_available() >= 0;
int ret;
ret = get_mempolicy(NULL, NULL, 0, NULL, 0);
- if (ret && errno == ENOSYS) {
+ if (ret && (errno == ENOSYS || errno == EPERM)) {
return false;
}
return numa_available() >= 0;