delete ThreadManager.tcc

Summary: somehow managed not to get this into the untemplating diff argh

Test Plan: compiles

Reviewed By: davejwatson@fb.com

Subscribers: trunkagent, alandau, bmatheny

FB internal diff: D1566434
move Codel to wangle

Summary: under folly::wangle::

Test Plan: ran unit for experimental/wangle, thrift/lib/cpp/concurrency, and a user of FbThreadManager

Reviewed By: hans@fb.com

Subscribers: trunkagent, fbcode-common-diffs@, fugalh, alandau, bmatheny, everstore-dev@, njormrod

FB internal diff: D1566128
recvfrom in thrift/TAsyncUDPSocket

Summary: The paramenter addrLen is an input/output parameter, and should be initialized as sizeof(rawAddr).  Otherwise we got errno=22 from time to time. In turn, failing gangplank healthcheks in proxygen.

Test Plan: fbconfig -r thrift && fbmake runtests;  tested in canary, see the task updates

Reviewed By: cgheorghe@fb.com

Subscribers: trunkagent, alandau, bmatheny

FB internal diff: D1571580

Tasks: 5191161
initialize addrLen to sizeof sockaddr rather its pointer

Summary: ^

Test Plan: fbconfig -r thrift && fbmake runtests; tested in canary

Reviewed By: davejwatson@fb.com

Subscribers: viswanath, praveenr, cgheorghe, alandau, bmatheny

FB internal diff: D1572209

Tasks: 5191161

Blame Revision: D1571580
FunctionSendCallback.

Summary:
[Thrift] FunctionSendCallback.

A callback object for callers interested in knowing when a message is sent, or when a send error is encountered. In particular, this is useful for callers sending oneway rpc messages. This might even be named `OnewayCallback`.

This is a convenience class allowing callers to pass a lambda expression instead of having to define an ad-hoc callback class and construct an instance.

Test Plan: Unit tests in `thrift/lib/cpp2/test/RequestChannelTest.cpp`.

Reviewed By: davejwatson@fb.com

Subscribers: trunkagent, alandau, bmatheny, dougw

FB internal diff: D1571459
Stylistic improvements for serialization tests.

Summary:
[Thrift] Stylistic improvements for serialization tests.

* Use descriptive test names.
* Keep test data in the tests.

Test Plan: Unit tests: `thrift/lib/cpp2/test/SerializationTest.cpp`

Reviewed By: davejwatson@fb.com

Subscribers: alandau, bmatheny, dougw

FB internal diff: D1572747
Some tests to prove C++ serialization on recursive structs.

Summary: [Thrift] Some tests to prove serialization on recursive structs.

Test Plan: Unit tests in: `thrift/lib/cpp2/test/SerializationTest.cpp`

Reviewed By: davejwatson@fb.com

Subscribers: alandau, bmatheny, dougw

FB internal diff: D1572860
Factor out mutex profiling

Summary:
This allows users of fbthrift to make use of mutex profiling. It
also separates out the mutex profiling entirely from the rest of the
concurrency primitives. This will allow a wider refactor across thrift to
deprecate use of custom mutex classes while retaining the ability to
profile the mutexes.

Test Plan: compiled proxygen and thrift and ran unit tests.

Reviewed By: davejwatson@fb.com

Subscribers: doug, alandau, bmatheny

FB internal diff: D1572413
ulong -> unsigned long

Summary:
This dates back to oldies like D45921. ulong is not standard, so
it doesn't compile on some platforms.

Test Plan: unit tests

Reviewed By: davejwatson@fb.com

Subscribers: doug, alandau, bmatheny, shikong

FB internal diff: D1572493
Reduce references to thrift spinlock part 1

Summary:
Not removing them all right now at @pgriess's request. The
affected files in this diff should be clean to change like this.

Test Plan: unit tests and contbuild

Reviewed By: davejwatson@fb.com

Subscribers: trunkagent, doug, sorg, alandau, bmatheny, pgriess

FB internal diff: D1573082

@override-unit-failures
fb thrift cocoa: pull in cocoa code generator from apache thrift

Summary:
fb thrift cocoa: pull in cocoa code generator from apache thrift
- adding the option to convert the objects to be immutable
- cleaning the generated ObjC code.
- improving the way we deal with ObjC namespaces (fields/classes prefixes)

Test Plan: IG Raindrop integration

Reviewed By: alandau@fb.com

Subscribers: davejwatson, ckwalsh, andrewcox, haijunz, trunkagent, ps, alandau, bmatheny, dancol, datagram@

FB internal diff: D1573839
Revert a special-case race fix which is causing failures with an EVB change.

Summary:
This reverts a fix (D1241245) to a race condition which was
happening in July.  This race is probably the same one which let to me
writing D1455885, and the two fixes are not compatible.  As the more
recent change is more generic, this diff reverts the older fix.  The
fix in the older diff still passes.

More specifically, the problem is that if the non-sync call fails (for
example, if the server is down), before the loop is invoked, the test
for _returnState.exception() before the loop will pass, and the state
set by terminateLoopSoon() in the EventBase will remain set.  On the
next call, if there is no exception before the loop, the loop will be
a noop, neither the error nor return fields in the state will be set,
and the assert() will happen.  The fix is to run the event loop
always, so if terminateLoopSoon() was called, the state it left behind
will be reset.

Without this change, the simplest way to repro this is to call a
method twice, so the client is bad the second time through with the
same evb.  This diff also adds a test to ThriftServerTest which does
that.

Test Plan:
_build/dbg/thrift/lib/cpp2/test/ThriftServerTest, and the
test described in #5217793

Reviewed By: davejwatson@fb.com

Subscribers: bmatheny, bsimmers, trunkagent, ruibalp, alandau, marccelani

FB internal diff: D1572519

Tasks: 5217793

Blame Revision: D1241245
Fix dynamic.thrift PHP namespace

Summary: Can't have dots!

Test Plan: generate flib

Reviewed By: campbell.m.adam@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1575239
update thrift to use managed connection

Summary:
Use the new managed connection code in folly.  Cleans things up a fair bit

The only catch was the current ConnectionManager code uses raw pointers, thrift expects shared_ptr so the request object can keep the channel around until the requests are finished

Test Plan: fbconfig -r thrift/lib/cpp2; fbmake runtests

Reviewed By: afrind@fb.com

Subscribers: trunkagent, njormrod, doug, fugalh, alandau, bmatheny, dcsommer, afrind

FB internal diff: D1519923

Tasks: 5002343
Remove thrift threadGate functionality

Summary: threadgate is dying, I don't think anyone is using this anyway.

Test Plan:
fbconfig -r thrift/lib/cpp2; fbmake runtests

watch contbuild to doublecheck there are no other users

Added test from task

Reviewed By: haijunz@fb.com

Subscribers: trunkagent, jsedgwick, doug, ruibalp, fugalh, alandau, bmatheny

FB internal diff: D1566615

Tasks: 4744134
Use exception_wrapper to generate uex string

Summary:
This uses the optimization in D1543596 to make D1538277 not
need to do a rethrow.  Paste of generator output diff here:
https://phabricator.fb.com/P16328955
@override-unit-failures

Test Plan: _build/dbg/servicerouter/client/cpp2/test/clientchanneltest --gtest_filter=Cpp2Test.ApplicationExceptionTest

Reviewed By: mshneer@fb.com

Subscribers: ruibalp, alandau

FB internal diff: D1559451
TSocketAddress -> folly::SocketAddress

Summary:
This is in folly now. This diff doesn't actually delete the
TSocketAddress header file yet since other projects in fbcode need a
codemod there first.

Test Plan: compile thrift, watch contbuild

Reviewed By: davejwatson@fb.com

Subscribers: trunkagent, doug, ruibalp, alandau, bmatheny

FB internal diff: D1577982

@override-unit-failures
split up /transport TARGETS

Summary:
We need some smaller targets for other projects that can't afford
to pull in the rest of /transport.

Test Plan: compile proxygen, unit tests, check liger deps

Reviewed By: ranjeeth@fb.com

Subscribers: ranjeeth, trunkagent, doug, alandau, bmatheny, pgriess, seanc

FB internal diff: D1577875

@override-unit-failures
fix server stop()

Summary:
Broken in D1519923, stop() doesn't close currently open connections.  Easy fix

the connectionmanager dropallconnections() method sets the connectionmanager pointer to null before calling this stop() method, so the check was slightly off.

Test Plan:
fbconfig -r thrift; fbmake runtests
fbconfig servicerouter/client/cpp/test:servicerouter_test; fbmake runtests

Reviewed By: haijunz@fb.com

Subscribers: trunkagent, doug, alandau, bmatheny

FB internal diff: D1577997

Tasks: 5232530
Fix build break

Summary: Introduced in D1577982

Test Plan: fbmake

Reviewed By: haijunz@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1580975

Blame Revision: D1577982