1. 30 Sep, 2014 3 commits
    • Andrii Grynenko's avatar
      Use RWSpinLock for Singleton mutex · 4833e0ef
      Andrii Grynenko authored
      Summary: We only need exclusive lock when we add items to singletons_. Each SingletonEntry has its own mutex, so it's safe to rely on it for any modifications within individual entries.
      
      Test Plan: Applied D1573880 and ran fbconfig -r servicerouter/client/cpp2 && fbmake runtests
      
      Reviewed By: chip@fb.com
      
      Subscribers: trunkagent, njormrod, hitesh, mshneer
      
      FB internal diff: D1579877
      4833e0ef
    • Nicholas Ormrod's avatar
      Malloc cannot include ScopeGuard · 23d9f0ec
      Nicholas Ormrod authored
      Summary:
      Because we put FBString and Malloc into libgcc, we have to be
      careful which dependencies they each have. We cannot include ScopeGuard.
      Reorganize the code a bit to avoid the ScopeGuard.
      
      Test Plan: fbconfig -r folly && fbmake runtests
      
      Reviewed By: je@fb.com
      
      Subscribers: trunkagent, sdwilsh, njormrod
      
      FB internal diff: D1580957
      23d9f0ec
    • Nicholas Ormrod's avatar
      Rare bug fix · b9719790
      Nicholas Ormrod authored
      Summary:
      By the birthday paradox, this will fail about once every 8,100
      runs. Dropping to 100 with cut that to 1 in 860,000.
      
      Test Plan: fbconfig -r folly && fbmake runtests
      
      Reviewed By: sdoroshenko@fb.com
      
      Subscribers: sdwilsh, njormrod
      
      FB internal diff: D1581238
      b9719790
  2. 26 Sep, 2014 29 commits
    • Anton Likhtarov's avatar
      Bump version to 10:0 · 0b326f2e
      Anton Likhtarov authored
      0b326f2e
    • James Sedgwick's avatar
      fix future executor test · bb8907be
      James Sedgwick authored
      Summary: This should be the last test abusing sleeps.
      
      Test Plan: ran
      
      Reviewed By: hannesr@fb.com
      
      Subscribers: fugalh, njormrod
      
      FB internal diff: D1580830
      
      Tasks: 5225808
      bb8907be
    • Jim Meyering's avatar
      folly/GroupVarint: fix a clang-caught heap-buffer-overrun · 05450621
      Jim Meyering authored
      Summary:
      Avoid a clang-caught heap-buffer-overrun
      and document that the ssse3 decoder requires at least 17 bytes
      of readable memory starting at the source pointer.
      * folly/GroupVarint.h (decode_simple): Comment out dead code.
      (decode)[__SSSE3__]: Add a comment describing this limitation.
      * folly/test/GroupVarintTest.cpp (testGroupVarint32):
      Include <algorithm> for use of std::max.
      Ensure that the buffer we use has length at least 17.
      
      Test Plan:
      Now, all tests succeed with clang/asan
      
      Reviewed By: simpkins@fb.com
      
      Subscribers: trunkagent, mathieubaudet, njormrod
      
      FB internal diff: D1579109
      
      Tasks: 5241437
      05450621
    • James Sedgwick's avatar
      RFC: future executor · 61386620
      James Sedgwick authored
      Summary:
      not necessarily for commit but i was playing around a bit with this today to see what it might look like, so i figured i'd put it up
      i assume this shenanigan isn't remotely safe (threadwise) without some extra magic... @fugalh we chatted about this last time i was in mpk a bit.
      maybe addFuture could take an executor to make sure the promise is fulfilled on the correct thread, or something.
      
      you'd have to reimplement timeouts via this executor or via futures if you wanted to get them via the futures channel, which makes sense anyway as this could be used with any Executor and not just ThreadPoolExecutor which owns that implementation
      
      also specialized makeFutureTry to take functions that return futures but treat them like they return the contained types, so fulfil() can be used liked then()
      this specialization could just as easily be done on fulfil() itself if we wanted.
      
      Test Plan: unit
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: hannesr, trunkagent, craffert, njormrod, fugalh, bmatheny
      
      FB internal diff: D1566369
      61386620
    • James Sedgwick's avatar
      fix more flakey tests · fa43917d
      James Sedgwick authored
      Summary: fixed the one brought up in the task, and tweaked another that could theoretically cause problems
      
      Test Plan: ran, though I have not been able to repro the
      
      Reviewed By: njormrod@fb.com
      
      Subscribers: fugalh, njormrod
      
      FB internal diff: D1575632
      
      Tasks: 5225808
      fa43917d
    • Simon Jenkins's avatar
      Set DEFAULT_CATCHUP_EVERY_N to 10 to get more accurate task expiration when busy event base · 3f54bba7
      Simon Jenkins authored
      Summary:
      when event base is busy we're timing out tasks too early.
      BIG SCARY NOTE: I don't have the thrift knowledge to know if there's sideeffects of this, please let
      me know if this change is harmful.
      
      Test Plan:
      tested internally
      
      Reviewed By: davejwatson@fb.com
      
      Subscribers: njormrod
      
      FB internal diff: D1578466
      
      Tasks: 4752162
      3f54bba7
    • Dave Watson's avatar
      Fix SocketAddress AF_UNIX support · 7b474bc6
      Dave Watson authored
      Summary: check external_ vs. AF_UNIX.  Also fix reset() to reset storage_.addr
      
      Test Plan: fbconfig folly/test:network_address_test; fbmake runtests
      
      Reviewed By: soren@fb.com
      
      Subscribers: tudorb, trunkagent, doug, njormrod
      
      FB internal diff: D1575098
      7b474bc6
    • Andrew Gallagher's avatar
      Add and fix BUCK files for folly · 96be3888
      Andrew Gallagher authored
      Summary:
      This gets almost all of folly building with buck.  There are a few
      cases we don't support yet (custom test wrappers for spooky test
      binaries, dlopen-enabled exception tracer binary, etc), but the
      vast majority is covered.
      
      Test Plan: built all build targets and ran all tests buck
      
      Reviewed By: sdwilsh@fb.com
      
      Subscribers: tjackson, sdwilsh, fugalh, njormrod
      
      FB internal diff: D1577256
      
      Tasks: 5055879
      96be3888
    • Marc Horowitz's avatar
      expose the class_name in an efficient way · d7364d7e
      Marc Horowitz authored
      Summary:
      Add a class_name method, which doesn't need to throw/catch
      regardless how the exception is captured.
      
      Test Plan: exception_wrapper_test
      
      Reviewed By: mshneer@fb.com
      
      Subscribers: njormrod
      
      FB internal diff: D1543596
      
      Tasks: 5025089
      
      Blame Revision:
      d7364d7e
    • Nicholas Ormrod's avatar
      Disable failing wangle test · 215076a5
      Nicholas Ormrod authored
      Summary:
      Under moderate load, this part of the test would fail. When
      there is resource contention, it is quite possible that the timeout will
      be exceeded. A further reduction of the time spread will render this
      test next to useless.
      
      Moderate load can be as little as running all of folly's tests at once,
      which is something that our testing infrastructure does quite
      frequently.
      
      fbconfig -r folly
      fbmake runtests
      
      Test Plan:
      fbconfig -r folly && fbmake runtests
      
      Reviewed By: hannesr@fb.com
      
      Subscribers: sdwilsh, fugalh, njormrod
      
      FB internal diff: D1576570
      
      Tasks: 5225808
      215076a5
    • 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
  3. 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
  4. 18 Sep, 2014 3 commits