- 13 Jan, 2015 15 commits
-
-
Peter Griess authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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
-
- 07 Jan, 2015 6 commits
-
-
Ajit Banerjee authored
-
Bob Haarman authored
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 authored
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 authored
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 authored
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 authored
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
-
- 29 Dec, 2014 19 commits
-
-
Dave Watson authored
-
Dave Watson authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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 authored
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
-