Skip to content

Commit fd6ea8a

Browse files
lmanganiauxten
authored andcommitted
AWS Lambda compatibility (#9)
* PR_SET_NAME workaround AWS Lambdas (and other virtualized platforms) lack of support for PR_SET_NAME causing a blocking exception. Pending an upstream PR or fix in ClickHouse, this patch allows this function to fail unharmed. The resulting executable has been tested on various platforms without drawbacks and discussed in clickhouse issue [29378](ClickHouse/ClickHouse#29378) $ sed -i '/Cannot set thread name/c\' /ClickHouse/src/Common/setThreadName.cpp * Disable AVX2 support
1 parent a01207f commit fd6ea8a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

chdb/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ elif [ "$(uname)" == "Linux" ]; then
4343
GLIBC_COMPATIBILITY="-DGLIBC_COMPATIBILITY=1"
4444
UNWIND="-DUSE_UNWIND=1"
4545
PYINIT_ENTRY="-Wl,-ePyInit_${CHDB_PY_MOD}"
46-
AVX_SUPPORT="-DENABLE_AVX=1 -DENABLE_AVX2=1"
46+
AVX_SUPPORT="-DENABLE_AVX=1 -DENABLE_AVX2=0"
4747
EMBEDDED_COMPILER="-DENABLE_EMBEDDED_COMPILER=1"
4848
else
4949
echo "OS not supported"

src/Common/setThreadName.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ void setThreadName(const char * name)
4343
#else
4444
if (0 != prctl(PR_SET_NAME, name, 0, 0, 0))
4545
#endif
46-
if (errno != ENOSYS && errno != EPERM) /// It's ok if the syscall is unsupported or not allowed in some environments.
47-
DB::throwFromErrno("Cannot set thread name with prctl(PR_SET_NAME, ...)", DB::ErrorCodes::PTHREAD_ERROR);
46+
// if (errno != ENOSYS) /// It's ok if the syscall is unsupported in some environments.
47+
// DB::throwFromErrno("Cannot set thread name with prctl(PR_SET_NAME, ...)", DB::ErrorCodes::PTHREAD_ERROR);
4848

4949
memcpy(thread_name, name, std::min<size_t>(1 + strlen(name), THREAD_NAME_SIZE - 1));
5050
}

0 commit comments

Comments
 (0)