Skip to content

Commit

Permalink
HPCC-32877 Fix abort in esp when accessing secrets from a vault
Browse files Browse the repository at this point in the history
The vault secret code uses httplib to request entries
from a vault.  The default compilation mode is to use select() rather
than poll(), but select() has a limit of 1024 sockets.  That means
that if a process has a large number of sockets (or files?) open
the select based code will fail.

Thsi commit defines CPPHTTPLIB_USE_POLL which enables the use of poll()

Signed-off-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday committed Oct 25, 2024
1 parent 6131e81 commit 8866af5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions system/jlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ include_directories (
${CMAKE_BINARY_DIR}/oss
)

# ensure httplib uses poll rather than select - otherwise it fail if too many sockets have been opened.
ADD_DEFINITIONS( -DCPPHTTPLIB_USE_POLL )

ADD_DEFINITIONS( -D_USRDLL -DJLIB_EXPORTS )
HPCC_ADD_LIBRARY( jlib SHARED ${SRCS} ${INCLUDES} )

Expand Down
3 changes: 3 additions & 0 deletions system/metrics/sinks/prometheus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ include_directories(
${HPCC_SOURCE_DIR}/system/httplib
)

# ensure httplib uses poll rather than select - otherwise it fail if too many sockets have been opened.
ADD_DEFINITIONS( -DCPPHTTPLIB_USE_POLL )

SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STRICT_CXX_FLAGS}")
ADD_DEFINITIONS( -DPROMETHEUSSINK_EXPORTS )
HPCC_ADD_LIBRARY( hpccmetrics_prometheussink SHARED ${srcs} )
Expand Down

0 comments on commit 8866af5

Please sign in to comment.