Set up .gitignore, remove some generated files

Summary: Now, building FBThrift OSS on Ubuntu leaves me with a clean git tree.

Test Plan: autoreconf --install, configure, make as per deps.sh (also tried make check, but that's broken)

Reviewed By: davejwatson@fb.com

Subscribers: alandau

FB internal diff: D1336073
Prevent race between client creation and module registration

Summary:
TClientBase iterates over event handler factories, while module
initialization adds new factories. This was supposedly hitting
ShardManager which does scribe logging (as a client) before or during
the initialization of their own ServiceFramework thrift service

Test Plan: contbuilt, followup with shard manager

Reviewed By: davejwatson@fb.com

Subscribers: vikas, alandau, bmatheny

FB internal diff: D1339848

Tasks: 4362615
Clarify writev() doc

Test Plan: fbgs for all TAsyncTransport uses and verify that no implementations rely on this.

Reviewed By: brianp@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1340948
Make a TTransportException avoid a std::exception_ptr

Summary: Converts one callsite to exception_wrapper.

Test Plan: There is a unit test for timeouts.

Reviewed By: mshneer@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1341017
Fixes for opensource build

Summary:
tried to build fbthrift and here are some fixes that helped me.

There were some other platform-specific problems:
- I had to change PYPATH from ##compiler/py/build/lib.linux-x86_64-2.7## to ##compiler/py/build/lib##
- I had to change #include "thrift/compiler/thrifty.yy.h" to #include "thrift/compiler/thriftyy.h"
- I had to add ##gen-cpp2/Sasl_constants.cpp##, ##gen-cpp2/Sasl_types.cpp## and ##gen-cpp2/SaslAuthService.cpp## to libthriftcpp2_la_SOURCES

Also configure.ac checks that Python version installed is >= 2.4 but actual version needed is 2.7

Test Plan: build fbthrift

Reviewed By: davejwatson@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1341232
un-deprecate `from` as an identifier

Summary:
Using `from` as an identifier was deprecated, with the warning
that it "will soon become a reserved keyword". That was 2011. Since we
still and probably will continue to use `from`, un-deprecate it by
removing the warning.

Test Plan:
built the thrift compiler, then prometheus, and there were no
warnings about "from"

Reviewed By: andrewcox@fb.com

Subscribers: ryandm, alandau

FB internal diff: D1340061
Don't check if optional fields are set to default values unless explicit default is set

Summary: This fixes a bug where optional fields were not being written if the default value was set, then reading the serialized data would result in a null value rather than a the default.

Test Plan: Regenerate hack thrift code, manually inspect, run www unit tests

Reviewed By: andrewcox@fb.com

Subscribers: davejwatson, alandau

FB internal diff: D1339666

Tasks: 4323789
python tsocket: surface the underlying error in exception message

Summary:
Needed this to debug a problem.  Don't know if this change would be
acceptable style-wise.  It exposes the underlying exception info which
include errno and description.

Test Plan: Runs for me, but no unittests found here

Reviewed By: haijunz@fb.com

Subscribers: ruibalp, alandau, bmatheny

FB internal diff: D1345350

Tasks: 4360674
MessageChannel interface uses folly::exception_wrapper

Summary:
Adds interfaces messageRecvErrorWrapped and messageSendErrorWrapped
which take a folly::exception_wrapper. Where possible, sets up plumbing to
avoid creating an exception_ptr. Future diffs will set up additional
plumbing, just chunking this into smaller parts for easier review. Up to you
if you would prefer me to commit all at once or not.

Test Plan: reran unit tests

Reviewed By: andrewcox@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1307122

@override-unit-failures
Add dummy loggers inside the thrift auth code

Summary: This basically sprinkles the auth code with logs. These dummy loggers can later be overriden to do more customized logging.

Test Plan: Ran the code, checked that the correct VLOGs are printed

Reviewed By: mhorowitz@fb.com

Subscribers: zwass, blackbird-ninjas@, jessicac, akhi, zacm, igorzi, marccelani, mshneer, alandau, bmatheny, acampi, rodrigos, wstefancik

FB internal diff: D1291635
Generate qualified enum name in Haskell

Summary:
Generate qualified enum name in Haskell
for example:
blackhole.BlackholeStatusCode => Blackhole_Types.BlackholeStatusCode

Test Plan:
generate and compile .thift with qualified enum name

Reviewed By: smarlow@fb.com

Subscribers: alandau

FB internal diff: D1347483

Tasks: 4384300
Kill exception_ptr interface for messageSendError, use only exception_wrapper

Summary: This completes migration for all send exceptions to exception_wrapper.

Test Plan: reran unit tests

Reviewed By: alandau@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1346189

Tasks: 4158028
resetException takes exception_wrapper

Summary: as title

Test Plan: doitlive

Reviewed By: alandau@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1346208
Expose EOR tracking state in TAsyncTransport

Summary:
There is a method to set the EOR tracking state, but no way to
query it. I am adding a way to query it so that clients of this API do not
shadow the state elsewhere.

Test Plan: used in separate diff, unit test

Reviewed By: rajat@fb.com

Subscribers: doug, fbcode-common-diffs@lists, davejwatson, andrewcox, alandau, bmatheny

FB internal diff: D1349839
Name some kerberos threads.

Summary: See title.

Test Plan: Build it. Run it. See it in gdb.

Reviewed By: andrei.bajenov@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1347272
Fix compilation after D1349839

Summary: D1349839 broke thrift/lib/cpp2/test/ChannelTest.cpp

Test Plan: fbmake & contbuilt

Reviewed By: haijunz@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1350441

Blame Revision: D1349839
Pipe allow_neg_keys and allow_neg_enum_vals to thrift cpp2 python compiler

Summary:
These options are accepted by the python compiler, but not properly passed
through to the cpp lex/yacc parser, resulting in warnings that are supposed to
have been suppressed

Reviewed By: andrewjcg@fb.com

Subscribers: doug, ruibalp, alandau

FB internal diff: D1351809
Sasl on server side uses folly::exception_wrapper

Summary: Avoid many throws by using folly::exception_wrapper in security code. However, this code was doing a lot of catch(...) so this is a very scary diff (folly::exception_wrapper needs the derived type whereas std::exception_ptr does not). Please review carefully.

Test Plan: reran unit tests

Reviewed By: mhorowitz@fb.com

Subscribers:

Tasks: 4158028

FB internal diff: D1307293
MessageChannel::messageReceiveError is bye-bye

Summary: convert the last call sites

Test Plan: reran unit tests

Reviewed By: alandau@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1352634

Tasks: 4158028
Don't create a default logger object for SaslClient

Summary: This was causing some unit tests to break. Basically in some places we assume that there is no logger set, but because of this, it was.

Test Plan: Ran unit tests

Reviewed By: mhorowitz@fb.com

Subscribers: alandau, bmatheny, wstefancik

FB internal diff: D1352908