Add sa_mask for SIGPIPE handler (#24824)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/24841/head
congqixia 2023-06-12 18:56:38 +08:00 committed by GitHub
parent e170110b88
commit ae2fe478a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -90,6 +90,9 @@ MinioChunkManager::InitSDKAPI(RemoteStorageType type) {
struct sigaction psa;
psa.sa_handler = SwallowHandler;
psa.sa_flags = psa.sa_flags | SA_ONSTACK;
// block multiple SIGPIPE concurrently processing
sigemptyset(&psa.sa_mask);
sigaddset(&psa.sa_mask, SIGPIPE);
sigaction(SIGPIPE, &psa, 0);
#ifdef BUILD_GCP
if (type == RemoteStorageType::GOOGLE_CLOUD) {