You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jk...@apache.org on 2017/09/22 17:11:58 UTC
thrift git commit: THRIFT-4283: fix TNamedPipeServer race condition
in interrupt Client: C++ Patch: jn.goor@evs.com
Repository: thrift
Updated Branches:
refs/heads/master 9462edb06 -> 4a6bff1c5
THRIFT-4283: fix TNamedPipeServer race condition in interrupt
Client: C++
Patch: jn.goor@evs.com
This closes #1368
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/4a6bff1c
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/4a6bff1c
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/4a6bff1c
Branch: refs/heads/master
Commit: 4a6bff1c5bd7eabe71966454d90dddeb48ed4d37
Parents: 9462edb
Author: James E. King, III <jk...@apache.org>
Authored: Fri Sep 22 12:24:10 2017 -0400
Committer: James E. King, III <jk...@apache.org>
Committed: Fri Sep 22 10:11:06 2017 -0700
----------------------------------------------------------------------
lib/cpp/src/thrift/transport/TPipeServer.cpp | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/4a6bff1c/lib/cpp/src/thrift/transport/TPipeServer.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/TPipeServer.cpp b/lib/cpp/src/thrift/transport/TPipeServer.cpp
index 3bceadf..5923a62 100644
--- a/lib/cpp/src/thrift/transport/TPipeServer.cpp
+++ b/lib/cpp/src/thrift/transport/TPipeServer.cpp
@@ -296,6 +296,10 @@ shared_ptr<TTransport> TNamedPipeServer::acceptImpl() {
// if we got here, then we are in an error / shutdown case
DWORD gle = GetLastError(); // save error before doing cleanup
GlobalOutput.perror("TPipeServer ConnectNamedPipe GLE=", gle);
+ if(gle == ERROR_OPERATION_ABORTED) {
+ TAutoCrit lock(pipe_protect_); // Needed to insure concurrent thread to be out of interrupt.
+ throw TTransportException(TTransportException::INTERRUPTED, "TPipeServer: server interupted");
+ }
throw TTransportException(TTransportException::NOT_OPEN, "TPipeServer: client connection failed");
}