20 Commits
Author SHA1 Message Date
Jens GeyerandClaude Opus 5.5 9931271628 THRIFT-6443: Count a client dropped while sending in the dispatch_rejection test
Client: cpp

With a non-blocking dispatch, serve() rejects and closes a client right
after accepting it, while the test client may still be writing its
request. When the close got there first, the send failed, the test
discarded that client, and if that happened to every rejected client
the check found no drop. too_many_pending_tasks_does_not_end_the_server
failed that way in about a third of the Windows CI jobs.

A fired client whose send fails with a transport error other than a
timeout now counts as dropped, like one that reads end-of-stream or a
reset.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 22:24:53 +02:00
Jens GeyerandClaude Opus 4.8 16e9f4c4e5 Keep TThreadedServer serving when a worker thread cannot be started
Client: cpp

TThreadedServer::onClientConnected() inserts the new client into its active-client
map and then starts a worker thread for it. When the thread cannot be started --
the process is out of threads, so std::thread's constructor throws -- two things
went wrong on the default (non-detached) configuration:

  - Thread::start() had already run setState(starting) but left thread_ null, and
    ~Thread()/join() dereferenced thread_ unconditionally for a non-detached thread,
    so destroying the failed worker crashed.
  - The exception is not a TTransportException, so the accept loop's only catch did
    not handle it; it unwound out of serve() and the server stopped accepting, with
    the client left in the active-client map.

Null-guard ~Thread()/join() so a never-started thread can be destroyed safely, and
catch the failure in onClientConnected(), remove the client from the map, and keep
serving -- the way TThreadPoolServer drops one client on a rejected dispatch and
continues.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-21 00:46:32 +02:00
Jens GeyerandClaude Opus 4.8 ecaa4054f5 Drop one client instead of ending the server when the task queue rejects it
Client: cpp

A thread-pool dispatch that the ThreadManager rejected -- a full pending
queue, or a non-blocking add() that could not enqueue -- threw past serve()
and stopped the server. That one client is now closed and serving continues,
as the Java TThreadPoolServer does on a rejected execution.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-20 23:23:43 +02:00
zeshuai007 6b1cb30f48 THRIFT-5217 Deprecated boost header
Client: cpp
Patch: Zezeng Wang

This closes #2158
2020-09-12 19:07:28 +02:00
Sebastian Zenker 042580f534 THRIFT-4762: Applied some C++11 refactorings to the runtime library and compiler (#1719)
* make use of C++11 override keyword
* added const specifier to TTransport::getOrigin()
* added more const correctness to the compiler
* make use of auto keyword
* replaced usage of NULL with nullptr
* make use of explicitly-defaulted function definition
* extended changelog
2019-01-29 09:48:12 -05:00
cyy ca8af9b48f THRIFT-4730: remove pthread code and refactor, ending up with just ThreadFactory 2019-01-11 09:13:12 -05:00
cyy 7f8aef7099 replace boost::atomic with std::atomic 2019-01-07 08:11:37 -05:00
cyy 316723add4 remove stdcxx namespace and use std directly 2019-01-07 08:11:37 -05:00
James E. King, III 533405e3f8 THRIFT-4376: fix more high impact coverity defects
Led to the discovery of incorrect lua socket error handling.

This closes #1405
2017-10-29 07:05:47 -04:00
James E. King, III 237a394add THRIFT-3974: fix ThreadSanitizer identified issues
Client: C++

This closes #1331
2017-08-12 16:15:59 -07: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
Jim King 5a3f855b4e THRIFT-3768 fix TThreadedServer refactoring issues with client lifetime guarantees
Client: C++
Patch: Jim King <jim.king@simplivity.com>

This closes #980
2016-07-08 22:08:22 +02:00
John Sirois 919752ca2f THRIFT-3628 Fix lib/cpp/test/TServerIntegrationTest.cpp to use ephemeral ports.
Client: Test (C++)
Patch: John Sirois

This was already the case for most of the suite, which, besides the one
fixed constructor, retrieved the port to dynamically already.

This closes #859
2016-02-14 22:47:19 +09:00
Konrad Grochowski e9bdb411fb THRIFT-3329: fix C++ tests incompatibility with boost-1.59
Client: C++
Patch: James E. King, III <jim.king@simplivity.com>

This closes #620
2015-09-25 21:04:57 +02:00
ben-craig fae08e774c THRIFT-3246 Reduce the number of trivial warnings in Windows C++ CMake builds
Client: cpp
Patch: Ben Craig <bencraig@apache.org>

This closes #553
2015-07-15 11:34:47 -05:00
Konrad Grochowski 1f6e380c5d make style applied 2015-05-18 19:47:28 +02:00
Konrad Grochowski 24ea0bf5df THRIFT-3130 - C++ Lib: removed no longer needed macro THRIFT_OVERLOAD_IF
Client: C++
Patch: Jim King <jim.king@simplivity.com>

This closes #483
2015-05-07 15:16:24 +02:00
Jim King 79c9911b87 THRIFT-3084 add optional concurrent client limit enforcement to lib/cpp threaded servers 2015-04-30 19:48:15 +02:00
Ben Craig 1684c42950 THRIFT-2441 Cannot shutdown TThreadedServer when clients are still connected
Author: James E. King, III <Jim.King@simplivity.com>
2015-04-24 08:52:44 -05:00