Skip to content

Commit e42b87b

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 0e2d4c2 commit e42b87b

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
@@ -49,8 +49,8 @@ void setThreadName(const char * name, bool truncate)
4949
#else
5050
if (0 != prctl(PR_SET_NAME, name_capped, 0, 0, 0))
5151
#endif
52-
if (errno != ENOSYS && errno != EPERM) /// It's ok if the syscall is unsupported or not allowed in some environments.
53-
throw DB::ErrnoException(DB::ErrorCodes::PTHREAD_ERROR, "Cannot set thread name with prctl(PR_SET_NAME, ...)");
52+
// if (errno != ENOSYS && errno != EPERM) /// It's ok if the syscall is unsupported or not allowed in some environments.
53+
// throw DB::ErrnoException(DB::ErrorCodes::PTHREAD_ERROR, "Cannot set thread name with prctl(PR_SET_NAME, ...)");
5454

5555
memcpy(thread_name, name_capped, name_capped_len);
5656
}

0 commit comments

Comments
 (0)