7 Commits
Author SHA1 Message Date
Jens GeyerandClaude Opus 5.5 e2545c2730 THRIFT-3590: Implement interruptChildren() for TPipeServer
Client: cpp

TPipeServer did not implement interruptChildren(), so TServer::stop() could
not end a client that was waiting on a pipe, and serve() did not return while
a client stayed connected.

TPipeServer now shares one event with every pipe it accepts.
interruptChildren() sets it. From then on, read() on such a pipe throws
TTransportException::INTERRUPTED, even when the client has sent data, as it
does on a TSocket that TServerSocket accepted. A write() that waits for the
client is interrupted as well. Closing the server sets the event too, again as
with TServerSocket, and setInterruptableChildren(false) turns all of this off;
it must be called before listen(). Anonymous pipes do synchronous I/O and are
not interrupted.

This changes behavior: TServer::stop() now disconnects the clients of a
TPipeServer instead of waiting for them, as it does for TServerSocket since
THRIFT-2441. setInterruptableChildren(false) restores the old behavior.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 22:40:16 +02:00
Johan NordströmandClaude Opus 5 479a5c75ce THRIFT-6329: Keep the TPipe implementation alive while a read or write uses it
Client: cpp

close() may run on a different thread than an in-flight read() or write().
Guard the implementation pointer with a critical section and hand each caller
its own reference, so that the implementation cannot be destroyed while a call
is using it.

close() now detaches the implementation before releasing it and then cancels
it, so that a read() or write() waiting on the pipe stops waiting for the peer
and throws TTransportException::INTERRUPTED. Every overlapped wait also watches
a cancel event of the implementation, which is set once and never reset, so a
cancel that comes before the I/O is issued is not lost. setPipeHandle() does
the same with the implementation it replaces. Anonymous pipes use synchronous
I/O and are not interrupted; their handles stay open until a call in progress
returns.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 22:10:06 +02:00
cyy 316723add4 remove stdcxx namespace and use std directly 2019-01-07 08:11:37 -05:00
James E. King, III 82ae9575cd THRIFT-2221: detect C++11 and use std namespace for memory operations (smart_ptr)
Client: C++

This closes #1328
2017-08-10 13:27:21 -04:00
James E. King, III df89913b8a THRIFT-3932 fixed ThreadManager concurrency issues, added more tests in that area, did a little refactoring and prettying up along the way
Client: C++

This closes #1103
2016-11-12 15:16:30 -05:00
jfarrell e2e5e22c11 THRIFT-3308: Fix broken test cases for 0.9.3 release candidate
client: build
Patch: jfarrell

Fix broken test cases, make check now passes with all files in dist
2015-08-25 14:59:40 -04:00
ben-craig af2d9c8b88 THRIFT-3224 Fix TNamedPipeServer unpredictable behavior on accept
THRIFT-3225 Fix TPipeServer unpredictable behavior on interrupt()
Client: cpp
Patch: Ben Craig <bencraig@apache.org> and Pawel Janicki <pjs.wcy@poczta.onet.pl>

This closes #544
2015-07-16 08:11:21 -05:00