1. 26 Sep, 2014 19 commits
    • Soren Lassen's avatar
      Fix some folly memory leaks found with clang:dev + asan · 03e99d2e
      Soren Lassen authored
      Summary:
      Reverts the revert of the small_vector and test parts of D1569246.
      I'm saving the SocketAddress fix for later, because it caused problems
      and needs more research.
      
      Test Plan:
      unit tests with clang:dev/asan
      
      Reviewed By: njormrod@fb.com
      
      Subscribers: mathieubaudet, philipp, meyering, njormrod
      
      FB internal diff: D1575574
      
      Blame Revision: D1575190
      03e99d2e
    • Dave Watson's avatar
      update thrift to use managed connection · d8e71911
      Dave Watson authored
      Summary:
      Use the new managed connection code in folly.  Cleans things up a fair bit
      
      The only catch was the current ConnectionManager code uses raw pointers, thrift expects shared_ptr so the request object can keep the channel around until the requests are finished
      
      Test Plan: fbconfig -r thrift/lib/cpp2; fbmake runtests
      
      Reviewed By: afrind@fb.com
      
      Subscribers: trunkagent, njormrod, doug, fugalh, alandau, bmatheny, dcsommer, afrind
      
      FB internal diff: D1519923
      
      Tasks: 5002343
      d8e71911
    • Danny Guo's avatar
      Revert "Fix folly memory leaks found with clang:dev + asan." · f760023d
      Danny Guo authored
      Summary: This reverts commit 2c726dcf86bb176fb3695739a3d8bca2f95c41e6.
      
      Test Plan: build it
      
      Reviewed By: soren@fb.com
      
      Subscribers: woo, mathieubaudet, njormrod
      
      FB internal diff: D1575190
      f760023d
    • James Sedgwick's avatar
      de-flake tests · 471b4b72
      James Sedgwick authored
      Summary: make these more serialized / event based so they don't get flakey under high load
      
      Test Plan:
      ran under load - caveat: i was not able to repro the flakiness @njormrod reported
      but by inspection these should be fine
      
      Reviewed By: njormrod@fb.com
      
      Subscribers: fugalh, njormrod
      
      FB internal diff: D1574640
      
      Tasks: 5225808
      471b4b72
    • Soren Lassen's avatar
      Fix folly memory leaks found with clang:dev + asan. · cae6c97a
      Soren Lassen authored
      Summary: I tried running folly/test with clang:dev and asan and found these leaks.
      
      Test Plan:
      unit tests with clang:dev/asan
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: davejwatson, trunkagent, mathieubaudet, njormrod, meyering, philipp
      
      FB internal diff: D1569246
      cae6c97a
    • James Sedgwick's avatar
      user-defined expirations · 395c7e78
      James Sedgwick authored
      Summary:
      Couple of notes:
      1. is it a bummer not to have per-task callbacks of some kind? the interfaces set up here only tell you that some task expired, not which one expired. TM calls back with the Runnable object. is that useful?
      2. std::chrono::* business is frustratingly verbose, but the safety/explicitness is nice. Not sure how I feel overall.
      3. perhaps expirations should be given in microseconds even if we don't think we can accurately accomplish that
      
      Test Plan: added unit
      
      Reviewed By: hans@fb.com
      
      Subscribers: fugalh, njormrod, bmatheny
      
      FB internal diff: D1563520
      395c7e78
    • Pavlo Kushnir's avatar
      Fix fbthrift build · 39d6939c
      Pavlo Kushnir authored
      Summary: Mcrouter open source build is failing because Codel is missing in fbthrift.
      
      Test Plan: visual
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: fugalh, njormrod
      
      FB internal diff: D1572122
      
      Blame Revision: D1566128
      39d6939c
    • Dave Watson's avatar
      fix unittest · c141ff51
      Dave Watson authored
      Summary: Looks like the test explicitly looks for InvalidAddressFamilyException.  I don't think any users are depending on this particular error type either way, I just switched it to InvalidAddressFamilyException
      
      Test Plan:
      unit tests
      
      Reviewed By: ldbrandy@fb.com
      
      Subscribers: doug, njormrod
      
      FB internal diff: D1570363
      
      Tasks: 5153819
      c141ff51
    • James Sedgwick's avatar
      thread safety for Observable::observers_ · 8cf3e4f8
      James Sedgwick authored
      Summary: this way we can subscribe to an observable and blast data through it simultaneously from different threads
      
      Test Plan: not much... the one client of rx compiles
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: fugalh, njormrod, bmatheny
      
      FB internal diff: D1560647
      8cf3e4f8
    • James Sedgwick's avatar
      stats for ThreadPoolExecutor · 7f3dac64
      James Sedgwick authored
      Summary:
      pool-wide stats via a call on the pool, and per-task stats (e.g. to be funneled into a histogram) via an rx subscription
      rx needs a little work before this diff is safe - e.g. synchronization around the subscriber list, and perhaps exposing whether there are any subscribers so we can skip stat tracking if no one is listening
      won't commit this without moving rx into folly/experimental of course
      
      the idea is that timeout/expiration notifications can also go through the same subscription channel
      
      haven't run the benchmarks yet and have to leave for the evening but tmrw i'll commit changes to the benchmark and get this stuff into windtunnel so i don't have to do so much manual output inspection on future diffs
      
      Test Plan: added unit
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: fugalh, njormrod, bmatheny
      
      FB internal diff: D1558424
      
      Tasks: 5002392, 5002425
      7f3dac64
    • James Sedgwick's avatar
      move rx to folly/experimental · c049b564
      James Sedgwick authored
      Summary: As above. I want to use this for the thread pools and it probably belongs in folly long-term anywya (if we stick with it)
      
      Test Plan: compiled the one user
      
      Reviewed By: hans@fb.com
      
      Subscribers: fugalh, mwa, jgehring, fuegen, njormrod
      
      FB internal diff: D1560578
      c049b564
    • James Sedgwick's avatar
      move Codel to wangle · 260f12ae
      James Sedgwick authored
      Summary: under folly::wangle::
      
      Test Plan: ran unit for experimental/wangle, thrift/lib/cpp/concurrency, and a user of FbThreadManager
      
      Reviewed By: hans@fb.com
      
      Subscribers: trunkagent, fbcode-common-diffs@, fugalh, alandau, bmatheny, everstore-dev@, njormrod
      
      FB internal diff: D1566128
      260f12ae
    • Nicholas Ormrod's avatar
      Fix lint errors · 69a28bbf
      Nicholas Ormrod authored
      Summary: Pass const StringPieces by value instead of reference.
      
      Test Plan:
      fbconfig -r folly && fbmake runtests
      
      Reviewed By: robbert@fb.com
      
      Subscribers: trunkagent, sdwilsh, njormrod
      
      FB internal diff: D1569488
      69a28bbf
    • Ranjeeth Dasineni's avatar
      rfc : -Wshorten-64-to-32 warnings in folly liger dependencies · 6fc7a48c
      Ranjeeth Dasineni authored
      Summary:
      This is not a fix but me seeking advice here. The context here is that in liger (our common network
      stack for mobile platforms), we saw bugs due to truncation and want to enable these warnings. To find those in our code,
      I had to first resolve the folly ones. I just got around by making the truncation explicit so that I can get to real errors.
      Ideally I would like owners to examine each case and fix the original/accept the explicit truncate if its intended. Let me
      know what you think. The last (least preferred) is for us to keep this as a liger only change. We have a couple of ways to
      do that but it would be nice to fix.
      
      N.B : this covers only liger dependencies
      
      Test Plan: errors resolved after these changes.
      
      Reviewed By: njormrod@fb.com
      
      Subscribers: trunkagent, doug, shilin, njormrod, seanc, pgriess
      
      FB internal diff: D1509355
      6fc7a48c
    • Nathan Bronson's avatar
      fix leak in MPMCQueueTest's use of boost::intrusive_ptr · 54ab6858
      Nathan Bronson authored
      Summary:
      MPMCQueueTest's intrusive reference count test implementation was
      incorrect, so it simultaneously didn't test what it should and had a leak.
      
      Test Plan: tests, plus new __thread to track lifetimes
      
      Reviewed By: meyering@fb.com
      
      Subscribers: njormrod, soren, meyering
      
      FB internal diff: D1569448
      54ab6858
    • Nicholas Ormrod's avatar
      Fix lint errors · 9f4a587c
      Nicholas Ormrod authored
      Summary: Lines exceeding 80 characters have been restructured.
      
      Test Plan:
      fbconfig -r folly && fbmake runtests
      
      Reviewed By: robbert@fb.com
      
      Subscribers: trunkagent, sdwilsh, fugalh, njormrod
      
      FB internal diff: D1568086
      9f4a587c
    • Nicholas Ormrod's avatar
      Increase wangle test timers · b6ee36ab
      Nicholas Ormrod authored
      Summary:
      When running all folly tests at once, as with
      fbconfig -r folly && fbmake runtests
      the wangle tests sometimes fail. Enough tests are running that the
      1-millisecond timer is too small, and is sometimes missed. Bumping
      it to 10 milliseconds.
      
      Test Plan:
      fbconfig -r folly && fbmake runtests
      
      Reviewed By: hans@fb.com
      
      Subscribers: sdwilsh, fugalh, njormrod
      
      FB internal diff: D1568124
      
      Tasks: 5180879
      b6ee36ab
    • Pavlo Kushnir's avatar
      Faster accessors for dynamic values · 8c62ae77
      Pavlo Kushnir authored
      Summary:
      Sometimes it is useful to have a fast accessor to a value stored in dynamic, without any type conversion. These still do the type check, but compiler has more room for optimization.
      
      Test Plan: build folly, will add unit tests/benchmarks if this makes sense at all.
      
      Reviewed By: njormrod@fb.com
      
      Subscribers: jdelong, njormrod
      
      FB internal diff: D1564867
      8c62ae77
    • Guohui Wang's avatar
      add function to push data from another cursor · cbfe1b0c
      Guohui Wang authored
      Summary:
      Add a function to Writable to push data from another cursor. Data in the input
      cursor could be in a buffer chain.
      
      Added test in IOBufCurosTest.cpp to test the new function.
      
      Test Plan: fbmake runtests;
      
      Reviewed By: simpkins@fb.com
      
      Subscribers: njormrod, net-systems@
      
      FB internal diff: D1563209
      
      Tasks: 4886058
      
      Blame Revision:
      cbfe1b0c
  2. 19 Sep, 2014 5 commits
    • dcsommer's avatar
      Bump version to 9:0 · df0b3c97
      dcsommer authored
      df0b3c97
    • Tudor Bosman's avatar
      Do not barf on invalid ELF files · 00a4fa1b
      Tudor Bosman authored
      Summary: The Haskell runtime does magic, and loads an ET_REL file directly.
      
      Test Plan: ran it
      
      Reviewed By: jon.coens@fb.com
      
      Subscribers: njormrod, rkroll
      
      FB internal diff: D1566853
      
      Tasks: 4401996
      
      @override-unit-failures
      00a4fa1b
    • Dave Watson's avatar
      move socketaddress to folly · 45c8738b
      Dave Watson authored
      Summary:
      Goes with IPAddress and MACAddress already in folly.
      
      * change namespace, add typedef in thrift.  Had to update forward decls to folly namespace.
      * change exception types to std:: types instead of TTransportException.  I fbgs'd for everywhere I could find trying to catch these and updated the type, there looked like there were only ~9 files or so.
      
      Test Plan: contbuild.
      
      @override-unit-failures
      
      Tests already passed in last run
      
      Reviewed By: simpkins@fb.com
      
      Subscribers: doug, ps, alandau, everstore-dev@, njormrod, fugalh, alikhtarov, bmatheny, jsedgwick
      
      FB internal diff: D1556916
      45c8738b
    • James Sedgwick's avatar
      fix occasional crash in cpu pool · e3e4ab20
      James Sedgwick authored
      Summary: need to initialize threadsToStop_ and make it signed so it doesn't underflow in rare races
      
      Test Plan: cpu pool unit tests no longer crash if run a ton of times
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: fugalh, njormrod
      
      FB internal diff: D1563524
      e3e4ab20
    • Dave Watson's avatar
      install connectionmanager headers · ea6c8014
      Dave Watson authored
      Summary: Install headers / compile files
      
      Test Plan: watch jenkins build
      
      Reviewed By: dcsommer@fb.com
      
      Subscribers: doug, fugalh, njormrod
      
      FB internal diff: D1564098
      ea6c8014
  3. 18 Sep, 2014 5 commits
    • Dave Watson's avatar
      Bump version to 8:0 · c534238d
      Dave Watson authored
      c534238d
    • dungcoi's avatar
      merge https://github.com/facebook/folly/pull/88 · 7909e172
      dungcoi authored
      Summary:
      merge https://github.com/facebook/folly/pull/88, missing install header
      
      Looks like fbthrift build needs this
      
      Test Plan: watch jenkins build still works
      
      Reviewed By: ckwalsh@fb.com
      
      Subscribers: doug, njormrod
      
      FB internal diff: D1563651
      7909e172
    • Sean Cannella's avatar
      Remove dependency on std::to_string · 1e06d081
      Sean Cannella authored
      Summary:
      Mobile platform clang doesn't currently support std::to_string
      so remove folly's dependency on it.
      
      Test Plan: existing tests
      
      Reviewed By: mpawlowski@fb.com
      
      Subscribers: kmdent, fma, benyluo, shikong, ranjeeth, subodh, pgriess, njormrod
      
      FB internal diff: D1562179
      
      Tasks: 5183325
      1e06d081
    • Matt Dordal's avatar
      fix race in Future::waitWithSemaphore · 079e4ffe
      Matt Dordal authored
      Summary:
      There's a race condition in waitWithSemaphore, specifically because we're
      returning a new future that's completed by the input future. As a result,
      that future may not be completed by the time waitWithSemaphore returns,
      although completion should be imminent.
      
      Test Plan:
      `var=0; while true ; do echo $((var++)); _bin/folly/wangle/wangle-test --gtest_filter='Future*' || break ; done`
      
      Before change two runs yielded 303 and 371.
      
      After change I killed the test at 11000.
      
      Reviewed By: njormrod@fb.com
      
      Subscribers: fugalh, njormrod
      
      FB internal diff: D1561281
      
      Tasks: 5180879
      079e4ffe
    • Nicholas Ormrod's avatar
      remove eof whitespace lines · 546bd3f5
      Nicholas Ormrod authored
      Summary:
      Remove lint errors from folly: trailing newlines
      
      find folly | xargs arc lint | grep -B3 EOF | grep ">>>" | egrep -o "folly[^:]*" | xargs -n1 sed -i '$d'
      
      folly/experimental/io/test/AsyncIOTest.cpp had two trailing newlines,
      the second was removed by hand
      
      @override-unit-failures
      
      Test Plan:
      fbconfig -r folly && fbmake runtests
      
      Pretty overkill for a whitespace diff, but why not.
      
      Reviewed By: robbert@fb.com
      
      Subscribers: sdwilsh, fugalh, njormrod
      
      FB internal diff: D1561213
      546bd3f5
  4. 17 Sep, 2014 6 commits
    • Dave Watson's avatar
      Bump version to 7:0 · 4ecd8cdd
      Dave Watson authored
      4ecd8cdd
    • Dave Watson's avatar
      move connectionmanager/managed connection to wangle · 0703c007
      Dave Watson authored
      Summary: Moar code sharing between proxygen/thrift.  Code must be moved to a common library: The only one we currently have is folly, but if someone wants to argue for a separate lib, that's cool too
      
      Test Plan: fbconfig -r proxygen; fbmake dev
      
      Reviewed By: dcsommer@fb.com
      
      Subscribers: doug, fugalh, bmatheny, njormrod
      
      FB internal diff: D1519919
      
      Tasks: 5002343
      0703c007
    • James Sedgwick's avatar
      ThreadPoolExecutor and its children CPUThreadPoolExecutor and IOThreadPoolExecutor · 79b9cc5f
      James Sedgwick authored
      Summary:
      Spun off from https://phabricator.fb.com/D1534506 as this seemed different enough for a new diff
      
      Similar to previous diff but attempts to reuse a common thread management process between cpu and io bound thread pools. Also sets the stage for other common functionality, e.g. stats, monitoring, timeouts, and so on
      
      Here is some output from the queue benchmark in common/concurrent with both of these pools added (changes to BM not in this diff): https://phabricator.fb.com/P16308560
      
      Test Plan: added a unit test, ran benchmark
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: fugalh, njormrod, bmatheny
      
      FB internal diff: D1555443
      
      Tasks: 5002392, 5002425
      79b9cc5f
    • Sean Cannella's avatar
      Fix folly signed/unsigned comparisons · a03331d8
      Sean Cannella authored
      Summary:
      Fix a few sign comparison issues in folly::IPAddress
      
      @override-unit-failures
      
      Test Plan: existing tests, compiled with clang
      
      Reviewed By: meyering@fb.com, davejwatson@fb.com
      
      Subscribers: njormrod, bmatheny, subodh, ranjeeth, pgriess
      
      FB internal diff: D1559152
      a03331d8
    • Marc Horowitz's avatar
      make with_exception() const work in all cases · 9d4d4b00
      Marc Horowitz authored
      Summary:
      Abstract the with_exception() logic into a static template
      function which will work with a const or non-const object.
      
      Test Plan: exception_wrapper_test
      
      Reviewed By: vloh@fb.com
      
      Subscribers: njormrod
      
      FB internal diff: D1549175
      
      Tasks: 5127267
      9d4d4b00
    • Shao-Chuan Wang's avatar
      Adding IO stats in AsyncIO. · 28f7ed4f
      Shao-Chuan Wang authored
      Summary:
      It would be great if we have IO stats tracking built within AsyncIO.
      It would enable upper layer application to better track the number of I/O
      that was submitted and completed
      
      Test Plan:
      $ fbmake runtests
      Test Results Summary:
      Passed: 1734
      100% successful
      
      Reviewed By: philipp@fb.com
      
      Subscribers: njormrod, schen, stanislav
      
      FB internal diff: D1557472
      
      Tasks: 5008299
      28f7ed4f
  5. 15 Sep, 2014 5 commits
    • Dave Watson's avatar
      Bump version to 6:0 · 785ae28b
      Dave Watson authored
      785ae28b
    • Chip Turner's avatar
      Add non-strict mode to folly::Singleton · 736c0e46
      Chip Turner authored
      Summary:
      It is difficult to guarantee every binary can call
      registrationComplete; for now, support a mode where we don't enforce the
      strict registration lifecycle.  In the fullness of time, we can make
      strictness the default.
      
      Test Plan: runtests
      
      Reviewed By: lins@fb.com
      
      Subscribers: lins, anca, njormrod
      
      FB internal diff: D1551688
      736c0e46
    • Victor Loh's avatar
      equality for exception_wrapper · 6b82bb37
      Victor Loh authored
      Summary:
      std::exception_ptr expose methods to compare equality and it
      will be great to do so for folly::exception_wrapper (it helps in gmock
      testing).
      
      Test Plan: added some unit tests to test this new functionality
      
      Reviewed By: mhorowitz@fb.com
      
      Subscribers: njormrod
      
      FB internal diff: D1546597
      6b82bb37
    • Dave Watson's avatar
      Make TSocketAddress use folly::IPAddress · 07286cf0
      Dave Watson authored
      Summary:
      Step 1 of moving TAsyncSocket and friends to folly.
      
      folly::IPAddress changes (can split these off if requested):
      * isLoopback looks for a single address, as opposed to subnet
      * For V6, isPrivate & isLoopback don't seem to check mapped addresses
      
      TSocketAddress changes:
      * Make union use folly::IPAddress instead of sockaddr struct.  external_ bool to tell if using AF_UNIX instead.
      * manage the port and scope/zone info ourselves
      
      @override-unit-failures
      
      Overriding failures, can't get contbuild to finish all builds after several tries.  None of the failures look related
      
      Test Plan:
      fbconfig -r thrift
      fbmake runtests
      fbconfig folly/test:network_address_test
      fbmake runtests
      
      Reviewed By: simpkins@fb.com
      
      Subscribers: snaptu-diffs@, trunkagent, hphp-diffs@, njormrod, fbcode-common-diffs@, doug, ruibalp, ps, alandau, bmatheny
      
      FB internal diff: D1479365
      
      Tasks: 3658665
      07286cf0
    • Jim Meyering's avatar
      folly: avoid used-uninitialized bug in a test · 73ebd0fd
      Jim Meyering authored
      Summary:
      Clang complained about this.
      * folly/gen/test/FileBenchmark.cpp (BENCHMARK): Initialize "rfd" to -1
      and verify that it is set to something nonnegative in the first
      BENCHMARK_SUSPEND block.
      
      Test Plan:
      Run this:
      fbconfig -r --clang --with-project-version clang:dev folly/gen && fbmake runtests
      and observe that compilation now succeeds. (and test results remain unchanged)
      
      Reviewed By: tudorb@fb.com
      
      Subscribers: njormrod
      
      FB internal diff: D1551180
      
      Tasks: 4090011
      73ebd0fd