Skip to content

Commit 06c6d1e

Browse files
Ignore SIGPIPE to prevent exit when writing to closed TLS sockets
1 parent 665760a commit 06c6d1e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

memtier_benchmark.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ void setup_signal_handlers()
112112
g_main_pid = getpid();
113113
gettimeofday(&g_benchmark_start_time, NULL);
114114

115+
// Ignore SIGPIPE to prevent exit when writing to closed TLS sockets
116+
// This allows the application to handle connection errors gracefully
117+
signal(SIGPIPE, SIG_IGN);
118+
115119
struct sigaction sa;
116120
sa.sa_handler = sigint_handler;
117121
sigemptyset(&sa.sa_mask);

0 commit comments

Comments
 (0)