Close cpp2channel early

Summary:
Close Header{Client,Server}'s cpp2Channel_ inside destroy()
rather than at destruction

Test Plan: contbuilt, adpublisher, adfinder

Reviewed By: davejwatson@fb.com

Subscribers: alandau, bmatheny, antonl

FB internal diff: D1382812

Tasks: 4510305
thrift: fix YACC/bison detection in configure.ac

Summary:
* thrift/configure.ac: Look for a prefix of "bison" in $YACC,
rather than the value of "bison -y", because with bison-2.4.1,
we get YACC='bison -o y.tab.c', which provokes the erroneous
diagnostic, "Please install bison".

Test Plan:
run autoreconf -vi && configure
and verify that we get past the YACC/bison check.

Reviewed By: davejwatson@fb.com

Subscribers: alandau

FB internal diff: D1383935
fix py compiler unittest

Summary: constructor function changed arguments, now needs a tcc file also

Test Plan: fbconfig thrift/compiler/py/generate/test; fbmake runtests

Reviewed By: haijunz@fb.com

Subscribers: doug, ruibalp, alandau

FB internal diff: D1384952

Tasks: 4523457
fixed copy pasta in comment

Test Plan: no

Reviewed By: alandau@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1386405
Don't log excessively

Summary: We were logging every principal read / write. This turns out to be ~500MB/s rate. Too high and doesn't buy us much.

Test Plan: loadgen

Reviewed By: acampi@fb.com

Subscribers: alandau, bmatheny, wstefancik

FB internal diff: D1388016
Allowing reassignment of Frozen2 Views

Summary: Since this was blocking @mhx

Test Plan: Red/Green refactor with unit tests

Reviewed By: mhx@fb.com

Subscribers: alandau, bmatheny, mhx

FB internal diff: D1388630
Reorganize some logging

Summary: This seems more useful

Test Plan: ./fanout_test -hostnames /tmp/hosts_small

Reviewed By: acampi@fb.com

Subscribers: alandau, bmatheny, rodrigos, wstefancik

FB internal diff: D1388498
Change enum values of "Evaluation Status", restrict invalid transitions

Summary:
- Add/remove/rename enum values
- Enforce status transitions

A future diff will rename 'Evaluation Status' to 'Validation Phase'

(Also fixing a smaller bug in IntRangeSet)

Test Plan: oprah_test

Reviewed By: pradvenkat@fb.com

Subscribers: gangli, java-diffs@lists, alandau, bmatheny

FB internal diff: D1367669

Tasks: 4221010
Add some more useful logs / remove unused ones

Summary:
Rather than saying what I added / removed, I'll just document the different log entries.

Two main ones that are always there:
sasl_ticket_fetch_latency - the time it takes to fetch a ticket. This number is the total and can include either going to the KDC, going to memory, or waiting for disk.
sasl_kdc_latency - if we do end up going to the kdc, this number will just record the time it took. This is not always set, but when it is, it is a good proxy for looking at our kdc performance

Debug ones:
t:FirstRtt,t:SecondRtt,t:ThirdRtt - the time the client spends waiting for each leg of the handshake. These represent network delay / server speed
t:PrepareFirstRequest - total time it took to prepare the initial request. This may include the time it took to fetch tickets, dns resolution, name parsing, waiting on the thread manager, etc.
t:WaitForTgt - time we spend waiting for a valid tgt. This time may include waiting for file parsing or a trip to the KDC.
t:InitBarebonesCcache - time it takes to init a ccache only containing the tgt. There may be contention around this, so this keeps track of that
t:ThreadManagerOverhead - overhead around having a thread manager, and any delays caused by it
t:EvbOverhead - delays caused by busy EVB's. Since the SASL handshake uses the evb queue, and every step of it schedules stuff back on the queue, any delays in the evb could be serious.

Test Plan: loadgen, looked at logs

Reviewed By: acampi@fb.com

Subscribers: akhi, mcduff, marccelani, mshneer, alandau, bmatheny, rodrigos, wstefancik

FB internal diff: D1389032
Change cpp generator to generate std::hash and equal_to declaration

Summary:
this enables users to use unordered_map or unordered_map for
user-defined types in thrift.

Test Plan: manually built

Reviewed By: davejwatson@fb.com

Subscribers: ruibalp, alandau

FB internal diff: D1381862
Remove AI_ADDRCONFIG

Summary:
Using AI_ADDRCONFIG makes it difficult to bind server sockets
in mostly IPv6-only environments where it's still expected that loopback
(127.0.0.1) will still work.  getaddrinfo will fail to return 0.0.0.0 as
a valid address to bind to since there are no IPv4 addresses defined
other than 127.0.0.1

See: http://fedoraproject.org/wiki/Networking/NameResolution/ADDRCONFIG

Test Plan: unit tests

Reviewed By: davejwatson@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1394512

Tasks: 4550247
AI_PASSIVE is only needed for bind/listen

Summary:
We can't use AI_ADDRCONFIG in IPv6 only since it requires a
non-loopback address to be configured for IPv4.
This un-breaks IPv6 only hosts.

Test Plan: unit tests, scribe_cat on an ipv6 only host

Reviewed By: haijunz@fb.com

Subscribers: ruibalp, alandau, bmatheny

FB internal diff: D1394059

Tasks: 4402056
WriteLock -> ReadLock

Summary: Change write to read lock... write lock was not needed.

Test Plan:
loadgen

Reviewed By: mhorowitz@fb.com

Subscribers: alandau, bmatheny, angelops, acampi, rodrigos, wstefancik

FB internal diff: D1381288
Separate lock for TimeSeries

Summary: Having the same lock over TimeSeries messed with our logging a bit.

Test Plan: Built, ran lodagen.

Reviewed By: mhorowitz@fb.com

Subscribers: acampi, rodrigos, alandau, bmatheny, wstefancik

FB internal diff: D1385834
fix build

Summary: :'(

Test Plan:
deployed SNAPSHOT and build
`experimental/ryandm/plugin-example` with it and a new thrift compiler

Reviewed By: rash@fb.com

Subscribers: java-diffs@lists, alandau, bmatheny

FB internal diff: D1395282
Add Duplex support

Summary:
Duplex is the client's ability to instantiate a server that is
able to respond to Thrift calls from the real server.

Test Plan: new test

Reviewed By: davejwatson@fb.com

Subscribers: ruibalp, alandau, bmatheny

FB internal diff: D1378742
Drop AI_ADDRCONFIG from TSocket

Summary:
Using AI_ADDRCONFIG makes it difficult to bind server sockets
in mostly IPv6-only environments where it's still expected that loopback
(127.0.0.1) will still work.  getaddrinfo will fail to return 0.0.0.0 as
a valid address to bind to since there are no IPv4 addresses defined
other than 127.0.0.1

See: http://fedoraproject.org/wiki/Networking/NameResolution/ADDRCONFIG

Test Plan: unit tests

Reviewed By: davejwatson@fb.com

Subscribers: alandau, bmatheny

FB internal diff: D1395449

Tasks: 4307994
Extract full list of client ciphers from SSL Handshake.

Summary:
The metadata from the client hello that we can get directly
from OpenSSL is limited. Parsing it ourselves lets us get much more
detail. Here, we obtain the client's full list of supported cipher suites
using a message callback instead of SSL_get_shared_ciphers.
The callback is installed before waiting for client hello in
handleAccept, and is removed when it finishes execution.

Test Plan:
Ran proxygen in front of sandbox on a custom config (to print the new
shared ciphers list to scribe.)
For Firefox:

Client Ciphers from callback (23): ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-RC4-SHA:ECDHE-RSA-RC4-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:DHE-RSA-CAMELLIA128-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:EDH-RSA-DES-CBC3-SHA:AES128-SHA:CAMELLIA128-SHA:AES256-SHA:CAMELLIA256-SHA:DES-CBC3-SHA:RC4-SHA:RC4-MD5
SSL_get_shared_ciphers (23): ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-RC4-SHA:ECDHE-RSA-RC4-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:DHE-RSA-CAMELLIA128-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:EDH-RSA-DES-CBC3-SHA:AES128-SHA:CAMELLIA128-SHA:AES256-SHA:CAMELLIA256-SHA:DES-CBC3-SHA:RC4-SHA:RC4-MD5

For Chrome:

Client Ciphers from callback (20): ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:cc14:cc13:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-RC4-SHA:ECDHE-RSA-RC4-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:RC4-SHA:RC4-MD5
SSL_get_shared_ciphers (18): ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-RC4-SHA:ECDHE-RSA-RC4-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:RC4-SHA:RC4-MD5

For more sample output, see https://phabricator.fb.com/P11490432.

Reviewed By: cgheorghe@fb.com

Subscribers: otto, ssl-diffs@, alandau, bmatheny, afrind, ajitb

FB internal diff: D1350134

Tasks: 4361052
replacing TLSv1_2_method by TLSv1_method

Summary:
TAsyncSSLSocket::getSSLClientCiphers was using TLSv1_2_method
which was not available in OpenSSL 0.9.8b in older versions of the gcc
platform being used by some projects

Test Plan: Unit tests, ran proxygen in Sandbox

Reviewed By: andrewcox@fb.com

Subscribers: alandau, bmatheny, dsp

FB internal diff: D1396525

Tasks: 4558797, 4361052, 4558774

Blame Revision: D1350134
Thrift[Http]: Use thrift_transport_size for default IOBuf size

Summary:
Make default size for allocating IOBufs to configurable via
thrift_transport_size

Test Plan:
fbconfig -r thrift/lib/cpp && fbmake opt &&
fbmake runtests_opt

Reviewed By: andrewcox@fb.com

Subscribers: mcduff, marccelani, hitesh, mshneer, alandau, bmatheny

FB internal diff: D1397069