Skip to content

Commit d66874c

Browse files
Federico GiovanardiJens-G
authored andcommitted
Do not shutdown() an external server socket
For the socket-activation use case the external socket should not be shutdown() when the TServerSocket is closed.
1 parent 4966d07 commit d66874c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/cpp/src/thrift/transport/TServerSocket.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,9 +767,11 @@ void TServerSocket::interruptChildren() {
767767
void TServerSocket::close() {
768768
concurrency::Guard g(rwMutex_);
769769
if (serverSocket_ != THRIFT_INVALID_SOCKET) {
770-
shutdown(serverSocket_, THRIFT_SHUT_RDWR);
771770
if( boundSocketType_ == SocketType::NONE) //Do not close the server socket if it owned by systemd
771+
{
772+
shutdown(serverSocket_, THRIFT_SHUT_RDWR);
772773
::THRIFT_CLOSESOCKET(serverSocket_);
774+
}
773775
}
774776
if (interruptSockWriter_ != THRIFT_INVALID_SOCKET) {
775777
::THRIFT_CLOSESOCKET(interruptSockWriter_);

0 commit comments

Comments
 (0)