Jim Meyering [Wed, 7 Jan 2015 16:05:04 +0000 (08:05 -0800)]
folly/String-inl.h (humanify): avoid -Wsign-compare error
Summary:
* folly/String-inl.h (humanify): Count with a signed type.
Otherwise, gcc-4.9 fails with e.g.,
folly/String-inl.h:596:33: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
folly/String-inl.h:601:32: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: philipp@fb.com
Subscribers: trunkagent, folly-diffs@
FB internal diff:
D1770451
Tasks:
5941250
Signature: t1:
1770451:
1420704354:
c841ca453a5586fbf474535ca26cef17f95427dd
Jim Meyering [Tue, 6 Jan 2015 20:40:30 +0000 (12:40 -0800)]
folly/AtomicHashArray: use an unsigned type for each of two counters
Summary:
* folly/AtomicHashArray.h (numEntries_, numPendingEntries_):
Use an unsigned type for each of these. They count things, can
never go below 0, and are compared to unsigned values.
Otherwise, gcc-4.9 would emit this:
folly/AtomicHashArray-inl.h:153:38: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: philipp@fb.com
Subscribers: trunkagent, folly-diffs@
FB internal diff:
D1770695
Tasks:
5941250
Signature: t1:
1770695:
1420683354:
bfa4775bc2f8aab74e34772308a5c8b1779243b8
Jim Meyering [Tue, 6 Jan 2015 20:45:11 +0000 (12:45 -0800)]
folly/AtomicHashMap-inl.h: avoid -Wsign-compare warning/error (easy)
Summary:
* folly/AtomicHashMap-inl.h (insertInternal): Do not declare
nextMapIdx to be signed ("int"), since we compare it against
variables of unsigned type. Otherwise, gcc-4.9 would give this
diagnostic:
folly/AtomicHashMap-inl.h:99:18: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
complaining about this comparison:
if (nextMapIdx >= kNumSubMaps_ ||
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: philipp@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1770683
Tasks:
5941250
Signature: t1:
1770683:
1420683505:
4452c7cb4f14f098be089601be906884036348ed
Jim Meyering [Tue, 6 Jan 2015 18:00:14 +0000 (10:00 -0800)]
Histogram and Timeseries vs gcc-4.9 and -Wsign-compare
Summary:
Address multiple -Werror=sign-compare issues exposed when building
tao with gcc-4.9.
In most of these changes I've changed the type of the index in
a for-loop from int to size_t. The important thing is to use
an unsigned type when the limit is also unsigned. I choose size_t
because the general recommendation (when writing portable code)
to avoid size-tied types like uint32_t and uint64_t unless you
have a very good reason to require them.
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 tao/server && fbmake dbgo
Reviewed By: andrei.alexandrescu@fb.com
Subscribers: trunkagent, net-systems@, folly-diffs@
FB internal diff:
D1766651
Tasks:
5941250
Signature: t1:
1766651:
1420594537:
56ef53ca233e1649469db9570942c1d5dd47cf6d
Jim Meyering [Wed, 7 Jan 2015 04:54:29 +0000 (20:54 -0800)]
folly/test/ForeachTest.cpp: avoid -Wsign-compare error
Summary:
* folly/test/ForeachTest.cpp: Change a "1" to "1U", so it matches
the signedness of the size_t upper bound.
Otherwise, gcc-4.9 fails with e.g.,
folly/Foreach.h:194:16: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: andrei.alexandrescu@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1770603
Tasks:
5941250
Signature: t1:
1770603:
1420679246:
56ef62ac7fa4413a4ad6310c3381a12bdc59e64c
Jim Meyering [Wed, 7 Jan 2015 17:30:43 +0000 (09:30 -0800)]
folly/stats/BucketedTimeSeries-defs.h: avoid -Wsign-compare error
Summary:
* folly/stats/BucketedTimeSeries-defs.h (BucketedTimeSeries):
Assume that maxDuration is never negative, and cast the signed
duration_.count() to size_t, to avoid this error from gcc-4.9:
folly/stats/BucketedTimeSeries-defs.h:38:18: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: andrei.alexandrescu@fb.com
Subscribers: trunkagent, net-systems@, folly-diffs@
FB internal diff:
D1770171
Tasks:
5941250
Signature: t1:
1770171:
1420669115:
61e6b8d3248f88b25736322c7066af015209fba5
Jim Meyering [Wed, 7 Jan 2015 16:09:26 +0000 (08:09 -0800)]
folly/Format-inl.h: use the correct type for fwrite return value (easy)
Summary:
* folly/Format-inl.h (folly): fwrite returns size_t, not ssize_t.
Fixing this avoids the following diagnostic from gcc-4.9:
folly/Format-inl.h:299:11: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: philipp@fb.com
Subscribers: trunkagent, net-systems@, folly-diffs@
FB internal diff:
D1770155
Tasks:
5941250
Signature: t1:
1770155:
1420668733:
62593231d35f5874521dba575f23b68891b2a4f9
Jim Meyering [Wed, 7 Jan 2015 16:13:57 +0000 (08:13 -0800)]
folly/Format-inl.h: avoid -Wsign-compare error
Summary:
* folly/Format-inl.h (IndexableTraitsSeq::at): Add an explicit
int-to-size_t cast (ok here, since we've just confirmed
that the value is not negative) to avoid this error from gcc-4.9:
folly/Format-inl.h:947:29: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: tjackson@fb.com
Subscribers: trunkagent, net-systems@, folly-diffs@
FB internal diff:
D1770193
Tasks:
5941250
Signature: t1:
1770193:
1420670569:
83ac19c2ca8cd408d7c86d7dce49e2d4b418941a
Jim Meyering [Wed, 7 Jan 2015 05:15:27 +0000 (21:15 -0800)]
folly/test/SpinLockTest.cpp: avoid -Wsign-compare error (trivial)
Summary:
* folly/test/SpinLockTest.cpp (trylockTestThread):
Change parameter type from int to size_t, to fix these:
folly/test/SpinLockTest.cpp:67:25: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
folly/test/SpinLockTest.cpp:82:60: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: philipp@fb.com
Subscribers: net-systems@, folly-diffs@
FB internal diff:
D1770564
Tasks:
5941250
Signature: t1:
1770564:
1420674373:
fa3020398e2df66590eb71f798419b6f555d07c4
Dave Watson [Wed, 7 Jan 2015 22:55:17 +0000 (14:55 -0800)]
Fix CPUObserver test
Summary: CPUObserver observe events happen in different threads than the IOThreadPool ones.
Test Plan: fbconfig folly/wangle/concurrent/test && fbmake runtests --stress-runs 48
Reviewed By: jsedgwick@fb.com
Subscribers: doug, fugalh, folly-diffs@
FB internal diff:
D1769345
Tasks:
5948465
Signature: t1:
1769345:
1420654316:
196121ca30c905497a0acade05b9d877c98f6eeb
Jim Meyering [Wed, 7 Jan 2015 21:40:41 +0000 (13:40 -0800)]
folly/wangle/bootstrap/ServerBootstrap.h: avoid -Wsign-compare error (trivial)
Summary:
* folly/wangle/bootstrap/ServerBootstrap.h:
Change type of a for-loop index from int to size_t.
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: jsedgwick@fb.com
Subscribers: fugalh, folly-diffs@
FB internal diff:
D1770091
Tasks:
5941250
Signature: t1:
1770091:
1420667597:
fbe9a5ba56a0e34e0480c82c8fb61128406ded95
Nicholas Ormrod [Wed, 7 Jan 2015 17:31:31 +0000 (09:31 -0800)]
AHM ASAN test adjustment
Summary:
The AHA-insert-race test case (a) does a LOT of iterations, and
(b) allocated and deallocates a lot of memory on each iteration.
The long iterations, by themselves, take 8s, and should be reduced.
Further, ASAN errors on these tests, since it needs to hold on to memory
for a bit of time and ends up OOMing.
Test Plan:
fbconfig -r 'folly' '--platform-all=gcc-4.8.1-glibc-2.17-fb' '--sanitize=address'
fbmake runtests Ahm.atomic_hash_array_insert_race
Reviewed By: robbert@fb.com
Subscribers: sdwilsh, folly-diffs@
FB internal diff:
D1767334
Tasks:
5941888
Signature: t1:
1767334:
1420612386:
4d6f4067b30d1cb7d20bcfeb0f31fac1339ead20
Jim Meyering [Tue, 6 Jan 2015 23:32:33 +0000 (15:32 -0800)]
folly/small_vector.h: avoid -Wsign-compare error
Summary:
* folly/small_vector.h (moveToUninitialized): Do not mix
signed and unsigned for-loop index/limit. Instead, eliminate
the intermediate "count" altogether and iterate as long as
"first" is not equal to "last". Otherwise, gcc-4.9 fails with e.g.,
folly/small_vector.h:115:18: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: soren@fb.com
Subscribers: trunkagent, folly-diffs@
FB internal diff:
D1767844
Tasks:
5941250
Signature: t1:
1767844:
1420601608:
987fd7f7d44197ed9919910c9b559b37fbe421b6
Jim Meyering [Wed, 7 Jan 2015 01:21:42 +0000 (17:21 -0800)]
folly/FBVector.h: avoid -Wsign-compare error (simple)
Summary:
* folly/FBVector.h (make_window): Declare "tail" to be
explicitly of the same type as "n". Otherwise, we'd
use the type of std::distance, which is unsigned, and
then compare that against "n" of type "size_type", which
is unsigned, and we'd get this from gcc-4.9:
folly/FBVector.h:1276:14: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: philipp@fb.com, andrei.alexandrescu@fb.com
Subscribers: trunkagent, njormrod, folly-diffs@
FB internal diff:
D1768346
Tasks:
5941250
Signature: t1:
1768346:
1420594452:
654dac805bb46f7c6a38b4e4102e4004720d6835
Jim Meyering [Wed, 7 Jan 2015 01:08:20 +0000 (17:08 -0800)]
folly/test/RangeTest.cpp: avoid -Wsign-compare error (trivial)
Summary:
* folly/test/RangeTest.cpp (NeedleFinderTest): Declare for-loop
index to be of type size_t. OTherwise, gcc-4.9 fails:
folly/test/RangeTest.cpp:910:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: philipp@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1768279
Tasks:
5941250
Signature: t1:
1768279:
1420593237:
246040eebd40e313bdb19799bb11d6639f1481de
Jim Meyering [Tue, 6 Jan 2015 23:29:48 +0000 (15:29 -0800)]
folly/experimental/test/BitsBenchmark.cpp: avoid -Wsign-compare error
Summary:
* folly/experimental/test/BitsBenchmark.cpp (benchmarkSet):
Another s/int/size_t/ change to type of for-loop index, to match
the type of the loop's upper bound.
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: davejwatson@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1767853
Tasks:
5941250
Signature: t1:
1767853:
1420587945:
f32a0ef33f6c5fa75598ecb114a243f83b31e550
Jim Meyering [Tue, 6 Jan 2015 23:15:46 +0000 (15:15 -0800)]
folly/wangle/channel/ChannelPipeline.h: avoid -Wsign-compare errors (trivial)
Summary:
* folly/wangle/channel/ChannelPipeline.h: Declare for-loop indices
to be of type size_t(not int), to match size of upper bound.
Otherwise, gcc-4.9 fails with e.g.,
folly/wangle/channel/ChannelPipeline.h:126:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: davejwatson@fb.com
Subscribers: fugalh, folly-diffs@
FB internal diff:
D1767783
Tasks:
5941250
Signature: t1:
1767783:
1420587925:
d662b75e6a62ebd5bacdde28ad6e1da22ef777ac
Jim Meyering [Tue, 6 Jan 2015 22:28:49 +0000 (14:28 -0800)]
folly/gen/Parallel-inl.h: trivial -Wsign-compare fix
Summary:
[just like https://phabricator.fb.com/
D1767160 --
I don't know why I didn't see this the first time]
* folly/gen/Parallel-inl.h (folly): Use a for-loop index of type
size_t (not "int") to match type of upper bound.
Otherwise, gcc-4.9 fails with this:
folly/gen/Parallel-inl.h:242:27: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: philipp@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1767520
Signature: t1:
1767520:
1420583501:
121f7212f78774adb6ca7cf67cbab83bf604cbbe
Jim Meyering [Tue, 6 Jan 2015 20:48:38 +0000 (12:48 -0800)]
folly/gen/Parallel-inl.h: trivial -Wsign-compare fix
Summary:
* folly/gen/Parallel-inl.h (folly): Use a for-loop index of type
size_t (not "int") to match type of upper bound.
Otherwise, gcc-4.9 fails with this:
folly/gen/Parallel-inl.h:242:27: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: davejwatson@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1767160
Tasks:
5941250
Signature: t1:
1767160:
1420577886:
6acfb7f6d50ed715dcf4058841aeabc39fa99cbc
Peter Griess [Tue, 6 Jan 2015 20:30:32 +0000 (12:30 -0800)]
Fix HHWheelTimer compilation bug in libc++ build
Summary:
- Manually swap bucket_ entries in HHWheelTimer to work around a bug in
libc++
Test Plan:
- fbconfig -r folly/io/async && fbmake runtests --extended-tests
- Sync to OS X and build there
Reviewed By: davejwatson@fb.com
Subscribers: trunkagent, doug, seanc, folly-diffs@
FB internal diff:
D1766601
Signature: t1:
1766601:
1420566916:
24a2911e997ee04f0934884bdf7b82345cb2b752
Hans Fugal [Tue, 6 Jan 2015 20:22:52 +0000 (12:22 -0800)]
join
Summary:
Fixes T5922800
(I think)
Test Plan:
TBH I don't know why detaching a temporary thread variable might cause the program to abort but this seems to be the most likely cause so I'm making this change and we'll see in a day or two if it fixes it.
The test still passes and doesn't hang
Reviewed By: davejwatson@fb.com
Subscribers: fugalh, exa, folly-diffs@
FB internal diff:
D1764374
Tasks:
5922800
Signature: t1:
1764374:
1420485233:
2e4c81776ef6b6bdae18fbf2e99f0deea37b7879
Jim Meyering [Tue, 6 Jan 2015 17:58:36 +0000 (09:58 -0800)]
folly/Format-inl.h: fix gcc-4.9-exposed shadowing warning/error (trivial)
Summary:
* folly/Format-inl.h (BaseFormatter): Move decls of P and END down
past the shadowed decls. Otherwise, gcc-4.9 would emit this:
./folly/Format-inl.h:209:10: error: declaration of 'p' shadows a previous local [-Werror=shadow-local]
./folly/Format-inl.h:202:8: error: shadowed declaration is here [-Werror=shadow-local]
./folly/Format-inl.h:210:10: error: declaration of 'end' shadows a previous local [-Werror=shadow-local]
./folly/Format-inl.h:203:8: error: shadowed declaration is here [-Werror=shadow-local]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 tao/server && fbmake dbgo
Reviewed By: andrewjcg@fb.com
Subscribers: trunkagent, net-systems@, folly-diffs@
FB internal diff:
D1766673
Tasks:
5941250
Signature: t1:
1766673:
1420569376:
22c5c3a012715e479b27ba6f0bde1a3b079a3be3
Dave Watson [Tue, 6 Jan 2015 18:36:31 +0000 (10:36 -0800)]
Thread Observer
Summary: Observer methods, so users of IOThreadPoolExecutor can do stuff when threads are added/removed. As a use case, previously the thrift server only used the threads already started when it started up, and assumed iothreadpool was never resized.
Test Plan: Added several unittests
Reviewed By: jsedgwick@fb.com
Subscribers: trunkagent, doug, fugalh, alandau, bmatheny, mshneer, folly-diffs@
FB internal diff:
D1753861
Signature: t1:
1753861:
1420236825:
54cbdfee0efb3b97dea35faba29c134f2b10a480
Jim Meyering [Tue, 6 Jan 2015 00:53:50 +0000 (16:53 -0800)]
folly/Range.cpp: avoid -Werror=sign-compare error with gcc-4.9
Summary:
* folly/Range.cpp (scanHaystackBlock): This method mistakenly
declared its "idx" (aka blockStartIdx) parameter to have signed type.
It is logically an unsigned type and is compared only with other
variables of unsigned type, so make it unsigned.
Here's the diagnostic:
folly/Range.cpp:202:44: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
folly/Range.cpp: In instantiation of 'size_t folly::detail::scanHaystackBlock(folly::StringPiece, folly::StringPiece, int64_t) [with bool HAYSTACK_ALIGNED = true; size_t = long unsigned int; folly::StringPiece = folly::Range<const char*>; int64_t = long int]':
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 tao/server && fbmake dbgo
Reviewed By: robbert@fb.com, philipp@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1765590
Signature: t1:
1765590:
1420506036:
7cbe2c454ad1f018a1c0aa5112a38bed1b2ac673
James Sedgwick [Tue, 6 Jan 2015 00:44:36 +0000 (16:44 -0800)]
fix 4.9 build
Summary:
see https://www.facebook.com/groups/
738749156173702/permalink/
798168656898418/
I suppressed "comparison between signed and unsigned integer expressions" warnings for this first pass because there a whole lot (dozens) of those. Do we suppress those with 4.8 or something? Never seen the warnings before.
I can't find anything in boost 1.57 docs/changelog indicating why implicit conversion of boost::optional<bool> -> bool doesn't compile anymore, but it doesn't.
Test Plan: fbconfig -r --platform-all gcc-4.9-glibc-2.20 --extra-cxxflags="-Wno-sign-compare" folly && fbmake opt && fbmake runtests_opt
Reviewed By: rhysparry@fb.com
Subscribers: trunkagent, fugalh, folly-diffs@
FB internal diff:
D1765093
Signature: t1:
1765093:
1420500411:
062acf841641c7f4142c9b48e8daa45327de6822
Hans Fugal [Tue, 6 Jan 2015 00:21:50 +0000 (16:21 -0800)]
(folly) osx bootstrap script
Summary:
This is a bootstrap script for building folly on osx. I attempted to make it Just Work⢠for anyone who uses Homebrew (http://brew.sh/) but even if it doesn't work out of the box it should be instructive for the motivated developer on OSX.
Facebook:
In #
5134151 Wangle used to not build, because something was using a futex. But that seems to have been rectified (or the build problems are hiding in headers that aren't used in the libfolly build).
I'll also update https://our.intern.facebook.com/intern/wiki/Folly/BuildingOnMac to point people to this script instead.
Test Plan:
Tested on my laptop which is running Yosemite (10.10.1)
Build, then inspect `otool -L .libs/*dylib`
Reviewed By: davejwatson@fb.com
Subscribers: folly-diffs@, exa
FB internal diff:
D1765248
Tasks:
5134151
Signature: t1:
1765248:
1420500905:
bc5da97a0446f502cb2badc85c9004ff0a62027a
Dave Watson [Mon, 5 Jan 2015 22:45:12 +0000 (14:45 -0800)]
fix bootstrap test on older kernels
Summary: another unittest that doesn't work without reuseport support, add a check
Test Plan: ran it on sandcastle187.prn2, works
Reviewed By: njormrod@fb.com
Subscribers: doug, fugalh, folly-diffs@
FB internal diff:
D1764395
Tasks:
5931982
Signature: t1:
1764395:
1420490666:
658aef148ebca9484534a0cebb228570e28f1002
Sergey Doroshenko [Mon, 5 Jan 2015 19:00:41 +0000 (11:00 -0800)]
folly: AsyncServerSocket::getAddress: prefer IPv6
Summary:
Can't connect from ipv6-only cluster to ipv4/ipv6 service which uses different ports.
Facebook:
A lot of tests start a service, get its port, and try to connect to 127.0.0.1:port, which breaks
after this diff since the port corresponds to IPv6 address, not IPv4. Fixing this by changing
127.0.0.1 to ::1 in places found by sandcastle.
```
fbconfig servicerouter/aggregator/tests servicerouter/client/cpp/test common/fb303/cpp/test thrift/lib/cpp2/test unicorn/hotswap/test common/client_mgmt thrift/test servicerouter/client/swig/tests unicorn/async/test servicerouter/selection/tests
```
Test Plan:
```
$ ./fastcopy_server --dir . &
$ netstat -atnlp | grep LISTEN | grep fastcopy
tcp 0 0 0.0.0.0:65478 0.0.0.0:* LISTEN 9348/./fastcopy_ser
tcp 0 0 :::52793 :::* LISTEN 9348/./fastcopy_ser
```
Reviewed By: philipp@fb.com
Subscribers: trunkagent, vkatich, fbcode-common-diffs@, chaoyc, search-fbcode-diffs@, davejwatson, andrewcox, mcduff, hitesh, unicorn-diffs@, alandau, mshneer, folly-diffs@, bmatheny, ps, soren
FB internal diff:
D1760372
Tasks:
5868818,
5886688
Signature: t1:
1760372:
1419992695:
e7d254b2b8f730baefc169effa236b8daa9d846d
Viswanath Sivakumar [Mon, 5 Jan 2015 18:46:07 +0000 (10:46 -0800)]
Fix use of SSL session TransportInfo after txn is detached
Summary:
De-couple TransportInfo fields from SSL session structs to avoid
dangling pointers.
Facebook:
We sometimes lazily copy TransportInfo in handler after
detachClientTransaction for logging. If the socket is closed, then this
creates dangling pointers to some SSL structs. This is an attempt to fix
that.
This is similar to what @ajitb did in
https://phabricator.fb.com/
D1666951 which had to be abandoned because of
memory overhead. Here, instead of copying the relevant fields per
transaction, we are only doing it once per session (shared_ptr), so the
memory overhead should be negligible.
Test Plan: Unit tests pass. Will canary
Reviewed By: afrind@fb.com
Subscribers: fugalh, bmatheny, ssl-diffs@, folly-diffs@, ajitb
FB internal diff:
D1757318
Tasks:
5865651,
5879508
Signature: t1:
1757318:
1420482488:
9f5144b499eb2086cf2a80243328db5715b48f88
Andrii Grynenko [Wed, 17 Dec 2014 04:33:44 +0000 (20:33 -0800)]
Replace singleton names with type tags
Summary: This change simplifies Singleton API (methods don't need to accept name) and the actual implementation. It also makes it similar to folly::ThreadLocalPtr. Additionally misspelled singleton name becomes compilation error, not runtime error. Some users were actually naming singletons, when that was neccessary, this should also be fixed.
Test Plan: unit tests for all touched projects
Reviewed By: chip@fb.com
Subscribers: trunkagent, fugalh, jsedgwick, fbcode-common-diffs@, mcduff, hitesh, mshneer, folly-diffs@
FB internal diff:
D1744978
Signature: t1:
1744978:
1419282587:
bd29dd8a70d7572530ac371a96a21764229bc397
Philip Pronin [Tue, 30 Dec 2014 10:20:41 +0000 (02:20 -0800)]
fix __cxa_throw signature
Summary: `__cxa_throw` signature didn't match C++ ABI (see 2.4.3 in http://refspecs.linuxfoundation.org/abi-eh-1.22.html), gcc 4.9 was complaining.
Test Plan: fbconfig -r folly && fbmake opt -j32
Reviewed By: soren@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1760492
Tasks:
5908365
Signature: t1:
1760492:
1420251038:
6d04683f96ac889ff348ca0485420c975819b90b
Nick Tchervenski [Tue, 30 Dec 2014 20:32:06 +0000 (12:32 -0800)]
add a UT for Wangle::Future for circular dependency
Summary:
Making sure Wangle can handle circular dependencies.
There was an actual code issue in September that cause a crash in Atlas
Adserver due to this. The issue has been since fixed and Adserver's code
has been changed to avoid such circular dependency. We're adding a unit
test for this case.
Unit test is added as per our conversation on the Wangle group: https://www.facebook.com/groups/
715931878455430/permalink/
770180369697247/
Test Plan:
Add the same test on a code base from Sep 20th, observe that it fails:
https://phabricator.fb.com/P19352007
Run the unit test on latest code base - it succeeds
Reviewed By: hans@fb.com
Subscribers: atlas2-eng@, fugalh, folly-diffs@, leizhao, mchughj, kit, mpechuk
FB internal diff:
D1761006
Tasks:
5384229
Signature: t1:
1761006:
1420238204:
74ffb3fe8b88a25a23ade8e0990e69d405ea7f1e
Hans Fugal [Fri, 2 Jan 2015 22:36:42 +0000 (14:36 -0800)]
Future::within
Summary: For when you have a future that you want to complete within a duration, else raise a `TimedOut` exception.
Test Plan: new unit tests
Reviewed By: jsedgwick@fb.com
Subscribers: trunkagent, fugalh, exa, folly-diffs@
FB internal diff:
D1756580
Tasks:
4548494
Signature: t1:
1756580:
1420215704:
862f68816fc3a9d05a77077c439bec002aa29cf3
Chip Turner [Wed, 31 Dec 2014 03:03:54 +0000 (19:03 -0800)]
Improve unit test output and logging to diagnose build breaks
Summary:
I can't repro the very frequent breakage we get from the unit
test framework, and it would be helpful to get the proper error messages
from it, so this adjusts the logging and changes a CHECK to an EXPECT to
get more data when the failure occurs.
Test Plan: runtests
Reviewed By: hans@fb.com
Subscribers: lins, anca, folly-diffs@
FB internal diff:
D1761800
Tasks:
5870141
Signature: t1:
1761800:
1420226753:
27a66fb0ce47cd57529e5fd0518550fb649c9eb5
Ajit Banerjee [Wed, 7 Jan 2015 20:24:42 +0000 (12:24 -0800)]
Bump version to 21:0
Bob Haarman [Tue, 30 Dec 2014 22:45:28 +0000 (14:45 -0800)]
some fixes for clang-3.5 compatibility
Summary:
Clang 3.5 performs more rigorous static analysis than compilers we've previously used, and accordingly comes up with some additional warnings. This diff fixes some of the issues clang-3.5 warns about.
Facebook:
Test Plan:
# after pulling in changes that allow clang-3.5 to be used
fbconfig --clang --with-project-version clang:3.5 -r common/memory && fbmake runtests_opt
fbconfig --clang --with-project-version clang:3.5 -r common/strings && fbmake runtests_opt
fbconfig --clang --with-project-version clang:3.5 folly/test && fbmake runtests_opt
Tests for common/strings and folly/test pass. common/memory has one test failure, which also occurs with clang-3.4, while eliminating a couple of test failures that clang-3.4 had.
Reviewed By: meyering@fb.com
Subscribers: fbcode-common-diffs@, sdwilsh, mathieubaudet, folly-diffs@
FB internal diff:
D1761101
Signature: t1:
1761101:
1419976252:
ff60166dc8986e1239f88012b5e552a7d204aede
Sean Cannella [Tue, 30 Dec 2014 18:01:11 +0000 (10:01 -0800)]
Don't use FOLLY_TLS on Android
Summary:
emutls as far as StaticMeta needs to use it is broken on
Android as well due to unspecified pthread_key cleanup order between the
emulated __thread and our manual uses of it. Use the alternative that we
use on __APPLE__ there as well.
Test Plan: compiled and ran consuming code on Android
Reviewed By: dancol@fb.com
Subscribers: fma, shikong, kmdent, benyluo, ranjeeth, subodh, folly-diffs@
FB internal diff:
D1760569
Tasks:
5265754,
5907613
Signature: t1:
1760569:
1419955865:
afe8f35dadda85393492ac9331e9f62a74f4fdad
Sarang Masti [Mon, 29 Dec 2014 22:39:03 +0000 (14:39 -0800)]
Allow conversion from a type T to itself
Summary: same as title
Test Plan: - fbconfig -r folly && fbmake runtests
Reviewed By: andrei.alexandrescu@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1754577
Signature: t1:
1754577:
1419618119:
4c1a59cd19b23de9a9f6574341944e5e80530d62
Dave Watson [Mon, 29 Dec 2014 20:18:39 +0000 (12:18 -0800)]
SharedThreadPool unittest
Summary: Add a test to check that the accept IOPool can be the same as the IO worker thread pool
Test Plan: unittest
Reviewed By: jsedgwick@fb.com
Subscribers: doug, fugalh, njormrod, folly-diffs@
FB internal diff:
D1710628
Signature: t1:
1710628:
1417469919:
6d81a9426b61e9f1b804114f895ed541e547110f
Keith Adams [Mon, 29 Dec 2014 18:46:01 +0000 (10:46 -0800)]
Add convenience functions to serialize to / deserialize from string
Summary: kma asked
Test Plan: tests added
Reviewed By: andrei.bajenov@fb.com
Subscribers: alandau, bmatheny, mshneer, folly-diffs@
FB internal diff:
D1756731
Signature: t1:
1756731:
1419442987:
afdccce166ef1f1e609d8894ea587915f6fea8e7
Dave Watson [Mon, 29 Dec 2014 18:40:59 +0000 (10:40 -0800)]
Bump version to 20:0
Dave Watson [Mon, 29 Dec 2014 17:58:29 +0000 (09:58 -0800)]
Kill fbthrift dep
Summary:
(almost) all the necessary code has been moved to folly. A couple last functions in SSLUtils, moved them to SSLContext
I think this is enough so that open source mcrouter doesn't need an fbthrift dep anymore - although stuff in mcrouter/facebook still uses thrift.
Test Plan:
fbconfig -r mcrouter; fbmake runtests_dev
contbuild will probably show some other projects to fix up for SSLUtils
Reviewed By: alikhtarov@fb.com
Subscribers: doug, ps, alandau, bmatheny, alikhtarov, mshneer, folly-diffs@
FB internal diff:
D1747133
Signature: t1:
1747133:
1418946064:
1c30a60e43f017213e5514d462f267f91761abbe
Hans Fugal [Sat, 27 Dec 2014 00:55:29 +0000 (16:55 -0800)]
Fix case of ThreadWheelTimekeeper.cpp in Makefile.am
Test Plan: jenkins
Reviewed By: ajitb@fb.com
Subscribers: exa, folly-diffs@
FB internal diff:
D1758358
Tasks:
5880251
Signature: t1:
1758358:
1419640865:
c9e9ea5922a602c44042c358777067e025800e6e
Hans Fugal [Sat, 27 Dec 2014 00:27:44 +0000 (16:27 -0800)]
(wangle) fix Makefile.am
Summary: Add some forgotten header and cpp files to `Makefile.am` for OSS build of folly.
Test Plan: jenkins
Reviewed By: ajitb@fb.com
Subscribers: exa, folly-diffs@
FB internal diff:
D1758318
Tasks:
5880251
Signature: t1:
1758318:
1419639812:
47f527fdb2b3d2c49e7557b4176c6ab2478091ae
Hans Fugal [Fri, 26 Dec 2014 23:18:11 +0000 (15:18 -0800)]
(wangle) Timeouts basic
Summary:
Add basic timeout functionality. This adds `futures::sleep` which makes an async Future that finishes after the given duration, and `Future::get` which blocks on the result and takes an optional timeout.
Introducing the folly::wangle::futures namespace (soon to be just folly::futures) which will hold our wangle utility functions, the things that live in the Future object in Twitter's scala code. We'll probably move when* and wait-ish methods in here too, and perhaps alias makeFuture-ish methods too, though James has me mostly convinced not to deprecate them at the folly::wangle level (because they're basically Future constructors and Future lives at folly::wangle)
`Future::delayed` after Twitter's helper of the same name
Test Plan: new and old unit tests
Reviewed By: davejwatson@fb.com
Subscribers: trunkagent, fugalh, exa, folly-diffs@
FB internal diff:
D1748894
Tasks:
4548494
Signature: t1:
1748894:
1419363496:
1f4a62ec8455989c1fcce845695ace1d01c101c8
Hans Fugal [Fri, 26 Dec 2014 23:18:08 +0000 (15:18 -0800)]
HHWheelTimer::cancelAll
Summary: Provide a way to massacre outstanding timers.
Test Plan: new test, and using in wangle (different diff)
Reviewed By: davejwatson@fb.com
Subscribers: jsedgwick, exa, folly-diffs@
FB internal diff:
D1753866
Tasks:
4548494
Signature: t1:
1753866:
1419361846:
58ff6ca4d01b0d546495b032b454c8bf0fdb0277
Nathan Bronson [Wed, 24 Dec 2014 04:46:39 +0000 (20:46 -0800)]
make futexWaitUntil tolerant of invalid time_point-s
Summary:
futexWaitUntil could generate an invalid timespec when presented
with a time_point from before the epoch, which resulted in an EINVAL from
the futex syscall. Debug builds crashed on this unexpected return value,
while release builds soldiered on. This path happened to be exercised
by the unit test. This diff fixes the unintentional deadline overflow
in the test, adds explicit testing of overflow behavior, and makes
futexWaitUntil handle invalid time_points in a sensible manner.
Test Plan:
1. new unit tests
2. fbmake runtests_dbg
Reviewed By: mssarang@fb.com
Subscribers: strager, njormrod, folly-diffs@
FB internal diff:
D1747972
Tasks:
5853949
Signature: t1:
1747972:
1419382193:
862c193a13428d96acb33c85f962f59203661f40
Tao Chen [Tue, 23 Dec 2014 22:49:20 +0000 (14:49 -0800)]
Revert "folly: AsyncServerSocket::getAddress: prefer IPv6"
Summary: This reverts commit
fc83e983e2376bccc80dc4b21890e3a41dbc211f.
Test Plan: none
Reviewed By: lucian@fb.com, robot9@fb.com
Subscribers: ps, bmatheny, folly-diffs@
FB internal diff:
D1756753
Tasks:
5883894,
5886688
Signature: t1:
1756753:
1419374764:
977160379cfa49530babb38022b9d4cc80573a7d
Viswanath Sivakumar [Tue, 23 Dec 2014 20:16:48 +0000 (12:16 -0800)]
Allow unregistering connect callback in AsyncSocket
Summary:
Sometimes when the socket is destroyed from a destructor, we wouldn't
want further callbacks on shutdown. We can unregister the readCallback_
by calling setReadCB(nullptr), but if the state is CONNECTING, we can
still get connectErr() callback. I found an ASAN trace (https://phabricator.fb.com/P18837265)
that turned out to be because of this inability to cancel this callback.
This provides a way to unregister the connect callback as well.
Test Plan: fbconfig -r folly && fbmake runtests
Reviewed By: afrind@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1751778
Tasks:
5852935
Signature: t1:
1751778:
1419363638:
26967c2d4fc5819e4d65ae706d217a954dfd784f
Chip Turner [Tue, 23 Dec 2014 18:40:17 +0000 (10:40 -0800)]
Fix incorrect 'test' statement in unit test
Summary:
The 'test' command uses one equal sign for string equality, not
two. bash apparently is okay with two, but zsh isn't, causing this test
to pass if your shell was bash and fail if it was zsh. The test now
passes with bash, bash in sh mode, zsh, and even dash.
Test Plan:
runtests, also, these pass (zsh failed before):
SHELL=/bin/bash _build/dbg/folly/test/subprocess_test
SHELL=/bin/sh _build/dbg/folly/test/subprocess_test
SHELL=/bin/zsh _build/dbg/folly/test/subprocess_test
SHELL=/bin/dash _build/dbg/folly/test/subprocess_test
Reviewed By: njormrod@fb.com
Subscribers: lins, anca, folly-diffs@
FB internal diff:
D1756090
Signature: t1:
1756090:
1419360674:
8576e61a6e0ee102612c5eae0e1fbd79cc397bfa
Chip Turner [Tue, 23 Dec 2014 18:19:39 +0000 (10:19 -0800)]
Fix Dwarf path handling to fix broken test
Summary:
Simplify the logic slightly to better handle joining paths.
This makes DwarfTest.cpp pass.
Test Plan: runtests
Reviewed By: njormrod@fb.com
Subscribers: lins, anca, folly-diffs@
FB internal diff:
D1756036
Tasks:
5871014
Signature: t1:
1756036:
1419359254:
123cc508b8836ea0b1485abe361b1c158538aa08
Mike Kolupaev [Tue, 23 Dec 2014 12:28:32 +0000 (04:28 -0800)]
folly::AtomicHashMap: fixed race between erase() and find()
Summary: advancePastEmpty() was called for all created iterators. It only makes sense for begin(). For find() it's harmful: find() shouldn't return an iterator to the next element if the key was removed. I suspect that the same race condition was possible for insert(), but I haven't tried to reproduce it.
Test Plan: Added a test for it. It fails without these changes.
Reviewed By: delong.j@fb.com
Subscribers: folly-diffs@, lovro
FB internal diff:
D1751280
Tasks:
5841499
Signature: t1:
1751280:
1419107193:
71311ff68d92d0a4dcf1941dacdfdc23c25255cc
Lucian Grijincu [Tue, 23 Dec 2014 10:19:34 +0000 (02:19 -0800)]
folly: AsyncServerSocket::getAddress: prefer IPv6
Summary: Can't connect from ipv6-only cluster to ipv4/ipv6 service which uses different ports.
Test Plan:
```
./fastcopy_server --dir . &
# netstat -atnlp | grep LISTEN | grep fastc
tcp 0 0 0.0.0.0:65478 0.0.0.0:* LISTEN 9348/./fastcopy_ser
tcp 0 0 :::52793 :::* LISTEN 9348/./fastcopy_ser
```
Reviewed By: philipp@fb.com, sdoroshenko@fb.com
Subscribers: ps, bmatheny, folly-diffs@
FB internal diff:
D1752846
Tasks:
5868818
Signature: t1:
1752846:
1419043494:
7cc0646882249f17258ade5ce7ae5619b13148a0
Andrei Alexandrescu [Wed, 17 Dec 2014 21:16:07 +0000 (13:16 -0800)]
Bring fbstring::operator+ to date with C++11
Summary: Some overloads, particularly with rvalue references, were missing. Also this fixes https://our.intern.facebook.com/intern/tasks/?t=
5849579
Test Plan: unittests
Reviewed By: simpkins@fb.com
Subscribers: trunkagent, las, net-systems@, njormrod, folly-diffs@
FB internal diff:
D1746319
Tasks:
5849579
Signature: t1:
1746319:
1418875228:
febb965cf52710a5e76b7c1cce5aec601086ad90
Sarang Masti [Sat, 20 Dec 2014 00:44:37 +0000 (16:44 -0800)]
Allow conversion from StringPiece to StringPiece
Summary: Allow conversion from folly::StringPiece to folly::StringPiece
Test Plan: - fbconfig -r folly && fbmake runtests
Reviewed By: mpawlowski@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1752609
Signature: t1:
1752609:
1419037172:
04846f658901306b53fb60c9eafbdf0f4d4d7005
Kai Wang [Sat, 20 Dec 2014 06:24:54 +0000 (22:24 -0800)]
Print linux TID while crashing
Summary:
For servers using GLOG, all thread ID are get from gettid system call. So it
is very useful if we print this ID so during debugging I can find the log
of crashing thread.
I'm not sure who should review this diff. Just found you guys from previous
diffs touched this file :)
Test Plan:
See the crash log.
*** Aborted at
1419029404 (Unix time, try 'date -d @
1419029404') ***
*** Signal 11 (SIGSEGV) (0x18) received by PID 18852 (pthread TID 0x7f52a1fff700) (linux TID 27908), stack trace: ***
Reviewed By: tudorb@fb.com
Subscribers: seanc, folly-diffs@
FB internal diff:
D1752301
Signature: t1:
1752301:
1419032887:
e43c2ace6914e54812149a8b8e84eaffaf42a09c
Andrew Gallagher [Sat, 20 Dec 2014 05:56:23 +0000 (21:56 -0800)]
Various Dwarf::Path fixes
Summary:
- Allow both `baseDir` and `subDir` to be empty. This can happen
if DW_AT_comp_dir is `.` and gets simplified to the empty string.
(The DWARF standard doesn't appear to disallow relative dirs here,
but I couldn't find anthing definitive).
- Fix `./` prefix stripping to avoid making paths like `.///hello` absolute.
- Fix `/` suffix stripping to avoid making the root dir reference (`/`) empty.
- Do `baseDir` and `subDir` swapping after simplification.
Test Plan: Added unittests.
Reviewed By: njormrod@fb.com
Subscribers: trunkagent, sdwilsh, folly-diffs@
FB internal diff:
D1747978
Signature: t1:
1747978:
1419014942:
87f14cb31b8c19b524d7a95b14d63cf5661a8634
Tudor Bosman [Sat, 20 Dec 2014 02:33:14 +0000 (18:33 -0800)]
Add comment explaining that RWTicketSpinLock<..., true> is not reentrant
Test Plan: no, it's a comment
Reviewed By: zanfur@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1752850
Tasks:
5823969
Signature: t1:
1752850:
1419043661:
673c68c0daad28b3fde9709e767b528b0dec8ad1
Mike Kolupaev [Fri, 19 Dec 2014 20:17:41 +0000 (12:17 -0800)]
Fixed folly::AtomicHashMap::iterator not advancing past empty submaps
Summary: A potential "real life" scenario that maybe can hit this bug is if we erase almost all elements and then iterate over the whole map.
Test Plan: Added a test for it.
Reviewed By: mwilliams@fb.com
Subscribers: folly-diffs@, lovro
FB internal diff:
D1751455
Tasks:
5866368
Signature: t1:
1751455:
1419016611:
b44c41d348f54397844460cb38002ad0d9704972
Giuseppe Ottaviano [Fri, 19 Dec 2014 17:50:57 +0000 (09:50 -0800)]
Remove unnecessary constraint from Range subpiece constructor
Summary:
D1746899 enforced the constraint (previously in a comment) on the
constructor `Range(const Range&, size_t, size_t)` that `Iter` is a
`const char*`. There is however no reason for this constraint.
This patch generalizes and simplifies the constructor, and since it
has the same semantics as `subpiece`, the latter is implemented in
terms of the constructor.
Test Plan:
fbconfig -r folly && fbmake runtests_opt
Reviewed By: soren@fb.com
Subscribers: trunkagent, folly-diffs@
FB internal diff:
D1747958
Signature: t1:
1747958:
1418930360:
fcd6beeda34e64ec8a34b9491a57674ae2265596
Dave Watson [Fri, 19 Dec 2014 17:24:38 +0000 (09:24 -0800)]
Move TAsyncTransport to folly as AsyncTransportWrapper
Summary:
This temporary class will be useful to cut dependencies on thrift
while (roughly) maintaining the old interface.
Fixup various test classes that depend on the interface. Next diff will be to cut fbthrift dep in proxygen/mcrouter
Test Plan: unit tests, jenkins
Reviewed By: hans@fb.com
Subscribers: fbcode-common-diffs@, andrewcox, alandau, bmatheny, alikhtarov, mshneer, trunkagent, doug, njormrod, folly-diffs@, davejwatson
FB internal diff:
D1696094
Signature: t1:
1696094:
1418762312:
6028815cce2845ac5f8e754132a038fabf5fd957
James Sedgwick [Fri, 19 Dec 2014 00:11:50 +0000 (16:11 -0800)]
onError callbacks
Summary:
We've discussed these a bunch and here they are. I stole a bunch of Hannes' magic from https://www.facebook.com/groups/
715931878455430/permalink/
772854686096482/ to make this easier
Test Plan: added lots of unit tests
Reviewed By: hans@fb.com
Subscribers: fugalh, folly-diffs@, hannesr
FB internal diff:
D1748418
Signature: t1:
1748418:
1418945606:
e14c7d6a31245e222bc6a0d259d0e2b9ddd5a830
JoelMarcey [Thu, 18 Dec 2014 20:29:54 +0000 (12:29 -0800)]
Bump version to 19:0
James Sedgwick [Thu, 18 Dec 2014 20:20:26 +0000 (12:20 -0800)]
codemod: merge folly/wangle and folly/experimental/wangle
Summary:
Various TARGETS could definitely use some rearranging but I'd rather wait until we're cut over to the new repo
Test Plan: wait for contbuild
Reviewed By: davejwatson@fb.com
Subscribers: ptarjan, joelm, trunkagent, hphp-diffs@, ps, fbcode-common-diffs@, fugalh, alandau, bmatheny, everstore-dev@, mwa, jgehring, fuegen, mshneer, folly-diffs@, hannesr
FB internal diff:
D1740858
Tasks:
5802833
Signature: t1:
1740858:
1418752569:
4d7d9c5b955e4d9fab4b322cf08a3d285e3db7ce
Dave Watson [Thu, 18 Dec 2014 19:13:55 +0000 (11:13 -0800)]
fix make test
Summary: autotools is fun. rule name has to match
Test Plan: No contbuild for this, only a jenkins hourly build: https://ci-builds.fb.com/job/folly/
Reviewed By: noamler@fb.com
Subscribers: doug, net-systems@, folly-diffs@
FB internal diff:
D1747221
Signature: t1:
1747221:
1418929497:
a29320b5e21a657fe7e0221d2bea8b332626627b
Dave Watson [Thu, 18 Dec 2014 17:48:05 +0000 (09:48 -0800)]
remove Cpp2WorkerFactory
Summary:
In preparation for a global IOThreadPoolExecutor - we can't override the workerFactory if we are using a global one.
Instead, add a new getEventBases() to IOTHreadPoolExecutro and just run code on each eventBase. For shutdown, explicitly add a stop(), instead of doing the work after loop() as exited
Cpp2Worker required minor changes to be able to use EventBaseManager's eventbase vs. their own
Test Plan: fbconfig -r thrift/lib/cpp2; fbmake runtests
Reviewed By: jsedgwick@fb.com
Subscribers: trunkagent, andrewcox, doug, fugalh, alandau, bmatheny, mshneer, folly-diffs@
FB internal diff:
D1734795
Signature: t1:
1734795:
1418759367:
b45f419e5cbc482a64a5873d9e00e3bcb071db5a
Giuseppe Ottaviano [Thu, 18 Dec 2014 02:19:00 +0000 (18:19 -0800)]
Disable implicit conversions from std::string for non-char* Range
Summary:
`Range<Iter>` has an implicit constructors from strings for any
`Iter`, however such constructors are invalid (compilation fails)
if `Iter` is not `[const] char *`.
This can be an issue for overload resolution: for example
struct IsString {
bool operator()(folly::Range<int*>) { return false; }
bool operator()(folly::StringPiece) { return true; }
};
IsString()(std::string());
fails to compile because the overload is ambiguous, even if the
conversion to `ByteRange` is invalid.
This patch disables all the invalid constructors from
`[const] char*`, `std::string`, and `fbstring`.
Test Plan:
fbconfig -r folly && fbmake runtests_opt
Reviewed By: philipp@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1746899
Signature: t1:
1746899:
1418868361:
50784c4993df0bd96eeb62c09c659d5e53964d9b
James Sedgwick [Wed, 17 Dec 2014 23:57:16 +0000 (15:57 -0800)]
stabilize IOFuturePool test
Summary: see attached task. concurrency is hard.
Test Plan: stress ran the hell out of it, induced failures before, can't after
Reviewed By: hans@fb.com
Subscribers: fugalh, folly-diffs@
FB internal diff:
D1746879
Tasks:
5589311
Signature: t1:
1746879:
1418860467:
0ec3f51a398eee8a836532770682a4c58758ce93
Adam Simpkins [Wed, 17 Dec 2014 18:31:50 +0000 (10:31 -0800)]
fix the open source build
Summary: Fix the path to detail/SpinLockImpl.h in Makefile.am
Test Plan: Will confirm the Jenkins builds pass for fbthrift and proxygen.
Reviewed By: davejwatson@fb.com
Subscribers: doug, net-systems@, exa, folly-diffs@
FB internal diff:
D1745795
Signature: t1:
1745795:
1418841636:
8a861275a62b018a8181541c7d70ba0890d7129f
Laurent Demailly [Wed, 17 Dec 2014 01:56:51 +0000 (17:56 -0800)]
fix bug with elf object left with file open upon error causing Entered fatal signal handler recursively later
Summary: fix bug with elf object left with file open upon error causing Entered fatal signal handler recursively later
Test Plan: run publisher at the limit
Reviewed By: tudorb@fb.com
Subscribers: trunkagent, chip, folly-diffs@
FB internal diff:
D1743052
Tasks:
5752190
Signature: t1:
1743052:
1418780889:
ad2ee0e6999cf417c2b9fd1ef6bc82d2086774a1
Adam Simpkins [Fri, 12 Dec 2014 02:22:37 +0000 (18:22 -0800)]
SpinLock improvements
Summary:
This makes several improvements to the SpinLock code:
- Add a SpinLock implementation using pthread_spinlock_t. On non-x86_64
platforms this is preferred over the pthread_mutex_t implementation
when available.
- For the pthread implementations, throw std::system_error on error,
rather than completely aborting the program using glog's CHECK()
macros.
- Update the pthread_mutex_t implementation to call
pthread_mutex_destroy() on destruction.
- Always unit test all implementations that can be compiled on the
current build platform, even though only a single implementation will
be selected as folly::SpinLock. This way x86_64 builds will still
unit test the pthread-based implementations.
Test Plan: Ran the unit tests.
Reviewed By: seanc@fb.com
Subscribers: trunkagent, doug, net-systems@, exa, folly-diffs@
FB internal diff:
D1735770
Signature: t1:
1735770:
1418445953:
b238aa8fb835a8d55e6e98e20c4615ae1938b98f
Adam Simpkins [Thu, 11 Dec 2014 21:40:27 +0000 (13:40 -0800)]
remove PortableSpinLock.h
Summary:
Remove the PortableSpinLock header file now that all call sites have
been migrated to the new SpinLock name.
Test Plan: Built and ran unit tests for folly, thrift, and proxygen.
Reviewed By: seanc@fb.com
Subscribers: trunkagent, doug, net-systems@, exa, folly-diffs@
FB internal diff:
D1734685
Signature: t1:
1734685:
1418335405:
e834f64d7282393e942a1de3638f4cf67410eaab
Adam Simpkins [Thu, 11 Dec 2014 21:23:05 +0000 (13:23 -0800)]
update call sites to use SpinLock
Summary:
Update call sites to use the new folly::SpinLock name, instead of
folly::io::PortableSpinLock.
Test Plan: Built and ran the folly unit tests.
Reviewed By: davejwatson@fb.com
Subscribers: doug, net-systems@, exa, folly-diffs@
FB internal diff:
D1734647
Signature: t1:
1734647:
1418334925:
1bbcffccd06907224de2a102f8d4bfbe1bd62fd1
Adam Simpkins [Thu, 11 Dec 2014 20:23:34 +0000 (12:23 -0800)]
rename io::PortableSpinLock to SpinLock
Summary:
folly::io::PortableSpinLock seems generally useful outside of the io
code. This moves it into the base folly namespace, and renames it from
PortableSpinLock to just SpinLock.
For most users, the main difference between MicroSpinLock and SpinLock
is that SpinLock provides a constructor that does the right thing, while
MicroSpinLock has to be explicitly initialized.
Test Plan:
Added some new unit tests, and tested both the MicroSpinLock and
pthread_spinlock_t implementations. I didn't test the Mac OS version,
although that code remains unchanged.
Reviewed By: seanc@fb.com
Subscribers: trunkagent, doug, net-systems@, exa, folly-diffs@
FB internal diff:
D1734632
Signature: t1:
1734632:
1418394033:
99f6fbe73b485a1d631a2ef7d1b39ea6f49ecb0b
Andrii Grynenko [Tue, 16 Dec 2014 04:36:43 +0000 (20:36 -0800)]
get_fast/get_weak_fast API for folly::Singleton
Summary: This adds API which makes folly::Singleton as performant as Meyers/static-object singletons.
Test Plan:
unit test + benchmark
============================================================================
folly/experimental/test/SingletonTest.cpp relative time/iter iters/s
============================================================================
NormalSingleton 333.32ps 3.00G
MeyersSingleton 100.00% 333.33ps 3.00G
FollySingletonSlow 0.35% 94.36ns 10.60M
FollySingletonFast 99.43% 335.24ps 2.98G
FollySingletonFastWeak 0.62% 53.74ns 18.61M
============================================================================
Reviewed By: alikhtarov@fb.com
Subscribers: trunkagent, folly-diffs@
FB internal diff:
D1741961
Signature: t1:
1741961:
1418765462:
d9806f1bf5275bfbe2c4c53a41b735bda93753fe
Cameron Pickett [Tue, 16 Dec 2014 21:02:26 +0000 (13:02 -0800)]
Add specific multi-bind to AsyncServerSocket
Summary:
Add a bind api similar to binding by port across all interfaces.
However, this bind will only attempt to bind sockets to the supplied
IP addresses. I'd like to add this to aid in moving TURN to IPv6.
TURN will use two specified addresses, one for IPv4, and one for IPv6, to
handle incoming connections from clients. In order to avoid duplicating
workers, we'd like to take advantage of the multi-socket implementation
of AsyncServerSocket. However, we don't want to bind to all interfaces,
especially for port 443.
Test Plan:
Plan to test by adapting TurnTcpListener to use this new API. See that
1. using one address still works as expected,
2. using zero addesses will cause exception
3. using multiple addresses works as expected
Will write unit tests if needed
Reviewed By: davejwatson@fb.com
Subscribers: hannesr, trunkagent, net-systems@, folly-diffs@, naizhi
FB internal diff:
D1729442
Tasks:
3633642
Signature: t1:
1729442:
1418752467:
22a60da4ec9009ea0b7fe28a8a436a179e0449aa
Nathan Bronson [Tue, 16 Dec 2014 18:34:47 +0000 (10:34 -0800)]
fix Futex when steady_clock and system_clock precisions differ
Summary:
To handle the strange relationship between steady_clock and
system_clock (on some platforms these represent only one type, on some
platforms they are separate) Futex::futexWaitUntil converts the deadline
to a duration and back. On Xcode 6 system_clock is measured in
microseconds and steady_clock in nanoseconds, resulting in a compilation
failure. This diff fixes it.
Test Plan:
1. compile snippet manually using Xcode
2. new unit test that causes the same implicit conversion failure in a slightly different way
Reviewed By: mssarang@fb.com
Subscribers: trunkagent, folly-diffs@
FB internal diff:
D1740903
Tasks:
5831196
Signature: t1:
1740903:
1418754770:
32c999abf1dc87415ffebf45083a903abbded9f2
James Sedgwick [Tue, 16 Dec 2014 18:26:24 +0000 (10:26 -0800)]
codemod: folly/wangle/ -> folly/wangle/futures
Summary: Last thing before moving experimental/wangle here. Once everything is in the same directory I'm probably going to consolidate experimental/wangle/concurrent with the executors in this directory into wangle/executors/. And probably rename some of these targets. For now, a dumb move is enough.
Test Plan: waiting for contbuild
Reviewed By: davejwatson@fb.com
Subscribers: trunkagent, fbcode-common-diffs@, chaoyc, search-fbcode-diffs@, lars, ruibalp, hero-diffs@, zeus-diffs@, vikas, danielg, mcduff, cold-storage-diffs@, unicorn-diffs@, ldbrandy, targeting-diff-backend@, netego-diffs@, fugalh, adamsyta, atlas2-eng@, alandau, bmatheny, adityab, everstore-dev@, zhuohuang, sweeney, mwa, jgehring, smarlow, akr, bnitka, jcoens, luk, zhguo, jying, apodsiadlo, alikhtarov, fuegen, dzhulgakov, mshneer, folly-diffs@, wch, tingy, hannesr
FB internal diff:
D1740327
Tasks:
5802833
Signature: t1:
1740327:
1418752541:
82d7486293b0a12938730ae66d480c120aded4dc
Andrii Grynenko [Fri, 5 Dec 2014 22:17:50 +0000 (14:17 -0800)]
Remove locking when getting ptr to Singleton
Summary: This removes one layer on locking on the fast path, when ptr to singleton object is read from SingletonEntry.
Test Plan:
unit test
Before:
============================================================================
folly/experimental/test/SingletonTest.cpp relative time/iter iters/s
============================================================================
NormalSingleton 335.26ps 2.98G
MeyersSingleton 99.50% 336.96ps 2.97G
FollySingleton 0.28% 120.64ns 8.29M
============================================================================
After:
============================================================================
folly/experimental/test/SingletonTest.cpp relative time/iter iters/s
============================================================================
NormalSingleton 336.76ps 2.97G
MeyersSingleton 99.91% 337.07ps 2.97G
FollySingleton 0.36% 92.69ns 10.79M
============================================================================
Reviewed By: alikhtarov@fb.com
Subscribers: trunkagent, folly-diffs@
FB internal diff:
D1727604
Signature: t1:
1727604:
1418701171:
1728b516191a8ec4439e981d78634370b4bcf7a1
James Sedgwick [Mon, 15 Dec 2014 21:09:47 +0000 (13:09 -0800)]
global io executor
Summary:
This is something we've talked about for a while. It's also an alternative to the mechanism in
D1714645.
If we like it, I'll do something similar for a global cpu executor. That functionality should probably just be
baked into Executor itself instead of a separate subclass, which is why the IOExecutor stuff is in Executor.h/.cpp,
because it'll be pretty similar. The main exception is that for getCPUExecutor() you could return a default global
InlineExecutor instead of exploding as in getIOExecutor()
Test Plan: wangle unit, will start plumbing this into the services in #
5003045 if we like it
Reviewed By: davejwatson@fb.com
Subscribers: hannesr, trunkagent, fugalh, alandau, mshneer, folly-diffs@, bmatheny
FB internal diff:
D1727894
Tasks:
5002442
Signature: t1:
1727894:
1418344077:
9e54088a6acb3f78e53011a32fd1dfe8b3214c1d
James Sedgwick [Mon, 15 Dec 2014 19:43:32 +0000 (11:43 -0800)]
move wangle/Executor.h to folly/ root
Summary:
this removes the dep EventBase has on wangle as we prepare to split off wangle
also changes namespace from folly::wangle to folly
Test Plan: just a couple of codemods so waiting for contbuild
Reviewed By: davejwatson@fb.com
Subscribers: trunkagent, fbcode-common-diffs@, chaoyc, search-fbcode-diffs@, zeus-diffs@, nli, cold-storage-diffs@, unicorn-diffs@, targeting-diff-backend@, hannesr, vighnesh, fugalh, alandau, bmatheny, adityab, zhuohuang, luk, darshan, gunjan, hdoshi, dzhulgakov, alihussains, panin, ves, mshneer, folly-diffs@, lins, nimishshah
FB internal diff:
D1737376
Tasks:
5802833
Signature: t1:
1737376:
1418423430:
82d219c34fcc50218c380a17435e5880e53db6bd
Chip Turner [Thu, 11 Dec 2014 06:14:09 +0000 (22:14 -0800)]
Improve performance of stringPrintf and related functions
Summary:
It turned out at least one optimization we were doing for
stringPrintf (using the tail of the input buffer) was causing a
performance degradation in some cases -- if the string was already
pre-sized, our resize() call would end up memset'ing the tail. In some
instances, this could cause significant performance penalties, such as
when multiple stringAppendf calls were made.
So, this diff removes the "optimization" around using the tail of the input
buffer and instead uses a standalone stack buffer. If vsnprintf deems
that buffer too small, a heap buffer is instead used.
As there is no std::string method that resizes the string to fill the
underlying buffer without setting the values to a default, and as it is
not legal to write past the end of the data buffer (even if capacity()
says there is enough), let's just abandon that optimization. It turns
out this doesn't have a major performance loss for most cases since,
with this diff, most small strings will fit on-stack and then hopefully
in the string's tail anyway.
Test Plan: runtests
Reviewed By: simpkins@fb.com
Subscribers: trunkagent, net-systems@, lins, anca, folly-diffs@
FB internal diff:
D1733774
Tasks:
5735468
Signature: t1:
1733774:
1418323943:
ec47007c9756aca6cf0466bce92722ac4c7e89b2
Andrew Chalfant [Fri, 12 Dec 2014 02:18:26 +0000 (18:18 -0800)]
Add convenience method for folly::join
Summary: While folly has join methods that return a string (and thus don't need a string referenced passed), it does not support this idiom with iterators. This diff adds support for calls like folly::join("/", itr.begin(), itr.end() - 1).
Test Plan: Unit test
Reviewed By: njormrod@fb.com
Subscribers: philipp, trunkagent, njormrod, folly-diffs@, yfeldblum
FB internal diff:
D1702892
Tasks:
5691439
Signature: t1:
1702892:
1418344206:
9c1736f5d8e41be1df71a415e3803fe846b387b7
Dave Watson [Tue, 25 Nov 2014 16:13:37 +0000 (08:13 -0800)]
AsyncUDPSocket
Summary:
Move AsyncUDPSocket to folly.
There is also one under realtime/voip/async that looks functionaly equivalent? I think this one is only used in gangplank currently.
Test Plan: contbuild
Reviewed By: hans@fb.com
Subscribers: trunkagent, doug, alandau, bmatheny, njormrod, mshneer, folly-diffs@
FB internal diff:
D1710675
Tasks:
5788116
Signature: t1:
1710675:
1417477000:
9aebb466757554a5fa49d7c36cb504b4d8711b68
Chip Turner [Thu, 11 Dec 2014 05:00:02 +0000 (21:00 -0800)]
Improve benchmarking around stringPrintf functions
Summary:
Before optimizing this code, it is better to measure different
aspects of it to ensure improvements are worth it and don'tintroduce
other regressions.
This adds a new benchmark as well as parameterizes an old one.
Test Plan: run it
Reviewed By: lovro@fb.com
Subscribers: lins, anca, folly-diffs@
FB internal diff:
D1733760
Tasks:
5735468
Signature: t1:
1733760:
1418313479:
9f572d5a4cf014bd266d91d0f7a75407d1514f65
Dave Watson [Thu, 11 Dec 2014 16:02:41 +0000 (08:02 -0800)]
Bump version to 18:0
James Sedgwick [Thu, 11 Dec 2014 15:41:44 +0000 (07:41 -0800)]
formatting nits in Executor.h
Summary:
sorry this was bothering me
also remove extra include
Test Plan: OK
Reviewed By: davejwatson@fb.com
Subscribers: fugalh, folly-diffs@
FB internal diff:
D1733723
Signature: t1:
1733723:
1418312030:
088eb084f69e2bd7703724464b2f3e71abc2607a
James Sedgwick [Thu, 11 Dec 2014 03:23:24 +0000 (19:23 -0800)]
future_* callbacks in ThreadManager thread
Summary:
This is a squashed diff consisting of the following approved diffs
D1714007
D1714645
D1715686
D1719963
D1720725
D1721838
D1721856
D1721920
D1721956
D1724910
D1728289
- execute future_* handlers in TM thread
- call async thrift clients from any thread, not just EB thread
- store a request's EventBase in the RequestContext for easier client management
* this last one will change in favor of using a global IO executor but this should still land as an intermediate step. See
D1727894
Test Plan: see component diff test plans. otherwise, contbuild.
Reviewed By: davejwatson@fb.com
Subscribers: trunkagent, ruibalp, targeting-diff-backend@, hannesr, alandau, prometheus-diffs@, jeremyfein, mshneer, folly-diffs@, bmatheny, tingy
FB internal diff:
D1732289
Tasks:
5003045,
5645785
Signature: t1:
1732289:
1418253508:
30b724a91717cf7fe21029e0a1eaf239db1650be
Nicholas Ormrod [Thu, 11 Dec 2014 01:41:17 +0000 (17:41 -0800)]
ConcurrentSkipList Bug
Summary:
Bug reported by Yan Lin (not a facebook employee) through @robbert.
@philipp and @jdelong: you are the only two remaining facebookers to have
made non-trivial changes to this code.
Description of bug: layer 0 is 1->4, and we're looking for 3. We pass
over 4, and see that 1 is less than 3 in the for loop. Now a race
condition: another thread inserts 2, so layer 0 is now 1->2->3. Then,
since ht==0, we return pred->skip(0), which is now 2 instead of 4.
Why this is bad: it really breaks the lower_bound function (lower_bound
calls findNode calls findNodeDownRight), since it returns an element
that is lesser.
This patch doesn't change the behavior of the code in the normal case;
it just recycles previously-computed values so that this race condition
doesn't crash and burn.
Patch based off of Yan Lin's in-email suggestion.
Test Plan:
fbconfig -r folly && fbmake runtests
Reviewed By: philipp@fb.com
Subscribers: sdwilsh, folly-diffs@, jdelong, robbert, philipp
FB internal diff:
D1732434
Signature: t1:
1732434:
1418260198:
8c707435825cfa2a1093b681e066f320193e98f2
Brian Watling [Wed, 10 Dec 2014 22:39:53 +0000 (14:39 -0800)]
Fix clang compilation
Summary: Fix shadowed variable name
Test Plan: compile
Reviewed By: mmandal@fb.com
Subscribers: fugalh, mathieubaudet, folly-diffs@
FB internal diff:
D1732033
Signature: t1:
1732033:
1418250864:
d460fea376ac93c05b86977629b95dac60b8b916
Dave Watson [Wed, 10 Dec 2014 22:34:00 +0000 (14:34 -0800)]
Only test multi accept if reuse port supported
Summary: Some contbuild machines aren't on 3.10 yet.
Test Plan:
fbconfig folly/experimental/wangle/bootstrap; fbmake runtests
tested on 3.2 and 3.10
Reviewed By: jsedgwick@fb.com
Subscribers: doug, fugalh, folly-diffs@
FB internal diff:
D1732040
Tasks:
5800250
Signature: t1:
1732040:
1418250452:
a3203ab5769494594f2bf0b50f1c62052ddeb24c
Sean Cannella [Wed, 10 Dec 2014 21:15:55 +0000 (13:15 -0800)]
Support -Wsign-compare compilation
Summary:
Due to how Conv.h uses the less_than template inside
not-actually-static static ifs clang still ends up validating generated
code inside a FOLLY_RANGE_CHECK which is never executed due to the
templated types. This code however still generates -Wsign-compare issues
so suppress that in order to allow includers to use this flag.
A simple example will illustrate this:
uint64_t foo = 1;
int bar = folly::to<int>(foo);
Test Plan: fbmake runtests
Reviewed By: meyering@fb.com, njormrod@fb.com
Subscribers: trunkagent, folly-diffs@, bmatheny, ranjeeth, subodh, kmdent, fma, shikong, pgriess, jdelong
FB internal diff:
D1731411
Signature: t1:
1731411:
1418243200:
ed1f34a1485669c9cb18f9f6029aca70e498953c
Brian Watling [Wed, 10 Dec 2014 19:04:28 +0000 (11:04 -0800)]
Use an IO thread pool executor by default
Summary:
Remove member variable name shadowing
Facebook: This diff adds a default executor for async requests which do not specify one. This ensures we don't run request callbacks on the event threads (which in turn ensures we don't make blocking tcc calls from the event threads)
Test Plan: fbconfig tao/client; fbmake runtests
Reviewed By: hannesr@fb.com
Subscribers: hannesr, fugalh, zhuohuang, folly-diffs@, tao-eng@
FB internal diff:
D1731078
Tasks:
5752037
Signature: t1:
1731078:
1418237801:
5b9bbe74c288292d5e7c7e6a38e67be864627d89
Adrian Hamza [Wed, 10 Dec 2014 17:43:25 +0000 (09:43 -0800)]
Add mock singleton injection support to folly/experimental Singleton (t5653148).
Summary: Add mock singleton injection support to folly/experimental Singleton (t5653148).
Test Plan:
Added unit tests for MockSingleton, all unit tests passed.
Validated this works for my scenario.
Reviewed By: andrii@fb.com
Subscribers: trunkagent, njormrod, folly-diffs@
FB internal diff:
D1690946
Tasks:
5653148
Signature: t1:
1690946:
1418080331:
948d7051a5e5a2653dc393c123f188c56072c6db
davejwatson [Wed, 10 Dec 2014 15:58:27 +0000 (07:58 -0800)]
Multi accept
Summary: Use acceptor pool instead of current thread for accepts. Use reuse_port option to support multiple threads
Test Plan: Updated unittests
Reviewed By: hans@fb.com
Subscribers: doug, fugalh, njormrod, folly-diffs@
FB internal diff:
D1710619
Tasks:
5788110
Signature: t1:
1710619:
1417477350:
eee5063186e582ef74c4802b8149563af029b3de
Philip Pronin [Tue, 9 Dec 2014 21:43:33 +0000 (13:43 -0800)]
fix Cursor::skipAtMostSlow bug introduced in
D1724111
Test Plan: fbconfig -r folly/io/test && fbmake runtests_opt -j32
Reviewed By: viswanath@fb.com
Subscribers: folly-diffs@
FB internal diff:
D1728927
Tasks:
5788015
Signature: t1:
1728927:
1418161580:
9ed66412e35c62486a56e19aa9bf119863b5f1a1
Blame Revision:
D1724111
Dave Watson [Mon, 1 Dec 2014 20:52:35 +0000 (12:52 -0800)]
Add REUSEPORT option to AsyncServerSocket
Summary:
Adds a reuse port option to AsyncServerSocket, so multiple sockets can bind to the same accept port. Allows for multiple accept threads, so accepts can be greater, since there is no longer a single accept lock.
reuse port option is ifdefd, since this wouldn't build with some of the older kernels otherwise.
Postponed overnight
Test Plan: Builds. Used in an upcoming diff.
Reviewed By: jsedgwick@fb.com
Subscribers: benj, trunkagent, doug, njormrod, folly-diffs@
FB internal diff:
D1710600
Tasks:
5488516,
5788110
Signature: t1:
1710600:
1418066966:
627e03857f9b5ff831f2922add08e90cc525c95c
Sean Cannella [Tue, 9 Dec 2014 00:25:48 +0000 (16:25 -0800)]
TransportInfo size mismatches
Summary:
The code that uses TransportInfo assumes these byte counts are
compatible with size_t so make them so.
Test Plan: compiled
Reviewed By: davejwatson@fb.com
Subscribers: fugalh, bmatheny, njormrod, folly-diffs@, benyluo, ranjeeth, fma, kmdent
FB internal diff:
D1725026
Tasks:
5538843
Signature: t1:
1725026:
1418061933:
b4072ca926e792716776ddc00d79db9376510859
Dave Watson [Mon, 24 Nov 2014 20:36:30 +0000 (12:36 -0800)]
set internal thread factory
Summary: Fix up a TODO
Test Plan: ?? Should I bother with a test?
Reviewed By: jsedgwick@fb.com
Subscribers: doug, fugalh, njormrod, folly-diffs@
FB internal diff:
D1710633
Signature: t1:
1710633:
1417469890:
9e8513140bae79da384c9d5418d4ea0840efbe6c
Dave Watson [Mon, 8 Dec 2014 18:25:14 +0000 (10:25 -0800)]
Set a better default for maxReadsPerEvent
Summary:
0 (infinity) seems like a bad default for this. Just found a 2~5% latency win in thrift by setting this to something more reasonable. Any reason not to set a better default globally?
Since this is already on for mcrouter/proxygen/thrift, the biggest change would probably be service router
tests postponed longer than 20 minutes
Test Plan:
thrift perf test, multifeed canary
Canary URL: https://our.intern.facebook.com/intern/feedtools/mycanary?id=davejwatson_20141208-102635_local.1418063194_d201eceec04e5e097a6dffb645a424d502db8742_
Reviewed By: afrind@fb.com
Subscribers: doug, net-systems@, njormrod, folly-diffs@, jsedgwick, haijunz, andrewcox, alandau, fugalh
FB internal diff:
D1725142
Signature: t1:
1725142:
1418066284:
c2e1cbf27b0c7a98cf2395f369683bbcce4cdce4