1. 20 Jul, 2015 6 commits
    • Steve O'Brien's avatar
      folly HHWheelTimer: fix loop variable · 489a7f09
      Steve O'Brien authored
      Summary: In nested loop, loop condition is incorrect.  Fixed var (should be `ii` not `i`)
      
      Reviewed By: @pgriess
      
      Differential Revision: D2255702
      489a7f09
    • Tom Jackson's avatar
      Making Optional throw exceptions instead of assert · 22e8caf3
      Tom Jackson authored
      Summary: I'm upgrading assertions to throws, since these are fatal in all circumstances. If something is explicitly `Optional`, it makes sense to fail loudly if it is misused in this manner.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2247612
      22e8caf3
    • James Sedgwick's avatar
      add SocketPair.h/.cpp to Makefile · 59bdbbcc
      James Sedgwick authored
      Summary: to unbreak OSS wangle tests build
      
      Reviewed By: @bugok
      
      Differential Revision: D2240264
      59bdbbcc
    • Tudor Bosman's avatar
      folly::Future-istic barrier · 83312f92
      Tudor Bosman authored
      Summary: What it says on the tin.
      
      Reviewed By: @fugalh
      
      Differential Revision: D2230390
      83312f92
    • Pavlo Kushnir's avatar
      Add an option to disable guard pages for fiber stacks · 84f796c9
      Pavlo Kushnir authored
      Summary: guard pages may make debugging more painful. For example, in some cases they increased "perf" initialization time.
      
      Reviewed By: @alikhtarov
      
      Differential Revision: D2247188
      84f796c9
    • Hannes Roth's avatar
      (Wangle) within should raise TimedOut() · 65fd92b6
      Hannes Roth authored
      Summary: I figured it out. This works. The two extra futures are a small overhead
      (just two pointers). The `Core`s are allocated anyway, so this is pretty
      much optimal.
      
      A timeout now raises on the current Future, and a fulfilled promise
      cancels the timeout Future.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2232463
      65fd92b6
  2. 15 Jul, 2015 8 commits
    • Sara Golemon's avatar
      Only try to use F_SETPIPE_SZ if it's available · c23480d0
      Sara Golemon authored
      Summary: As the comment says, we can ignore errors in setting the size.
      So it stands to reason we can ignore setting the size as well.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2242882
      c23480d0
    • Sophia Wang's avatar
      Make DestructorGuard inherit from a base · f46045c9
      Sophia Wang authored
      Summary: There are more use cases that the Destruction/Guard pattern can be
      used than current DelayedDestruction provides. This diff makes the pattern more
      general (remove self destruct) and lets DelayedDestruction derive from that.
      The functionalities of DelayedDestruction is kept unchanged.
      
      I leave destroy(), Destructor class, and destroyPending_ in DelayedDestruction
      since they are not required by our CallbackGuard in proxygen.
      
      I add a shouldDestruct() function to allow customized conditions on when to
      call destructor.
      
      I haven't made destroyNow() a std::function since I only need it to be set at
      instatiation time. If there is any other use case that needs destroyNow() to be
      a std::function, I can do that as well.
      
      Reviewed By: @afrind
      
      Differential Revision: D2202575
      f46045c9
    • Joe Richey's avatar
      Actually denote when we have infinite generators · a1107271
      Joe Richey authored
      Summary: Before we didn't do anything at all with the ::infinite value for our
      generators, now all the sources operators and sinks are properly notated. The
      one signifcant change regarding what is allowed concerns 'cycle' which now (when
      called with no arguments) always produces an infinite generator. This is fine
      for all but the weirdest of generators fed into cycle.
      
      Reviewed By: @ddrcoder
      
      Differential Revision: D2240328
      a1107271
    • Joe Richey's avatar
      Changing behavior of 'any' and 'all' sinks, adding in 'isEmpty' and 'notEmpty' sinks · 43d53e06
      Joe Richey authored
      Summary: When adding in the 'filter()' default behavior, I considered adding in similar
      behavior for 'any' and 'all'. However, we had 'any' with no funciton call
      basically check if anything was present, not testing a predicate. This can
      create a confusing senario, so I removed this behavior from 'any' and added in
      the 'isEmpty' and 'notEmpty' sinks. Now the calls 'any()' and 'all()' (called
      with parens, so old uses won't compile) check for truthy values simlar to
      'filter()'.
      
      I also added some unit tests and changed 'static const' objects to 'constexpr'.
      
      Reviewed By: @ddrcoder
      
      Differential Revision: D2234637
      43d53e06
    • Andrii Grynenko's avatar
      RequestContext support · cc671d29
      Andrii Grynenko authored
      Summary: Integrating RequestContext into fibers library. RequestContext is saved for every task, when that task is created. If RequestContext is overriden when a task is being run (within fiber, in runInMainContext, within function passed to await call) the new context will continue to be used for the task.
      
      Reviewed By: @alikhtarov
      
      Differential Revision: D2240152
      cc671d29
    • Lucian Grijincu's avatar
      folly: AsyncIOOp: improve logging message: add strerror · 5016d8c7
      Lucian Grijincu authored
      Reviewed By: @philippv
      
      Differential Revision: D2240628
      5016d8c7
    • Yedidya Feldblum's avatar
      Fix Build: folly/io/async/test/ScopedEventBasedThreadTest.cpp · 0525207e
      Yedidya Feldblum authored
      Summary: [Folly] Fix Build: folly/io/async/test/ScopedEventBasedThreadTest.cpp
      
      Failure with latest clang:
      
          folly/io/async/test/ScopedEventBaseThreadTest.cpp:72:8: error: explicitly moving variable of type 'folly::ScopedEventBaseThread' to itself [-Werror,-Wself-move]
            sebt = std::move(sebt);
      
      Reviewed By: @markisaa
      
      Differential Revision: D2238762
      0525207e
    • Yedidya Feldblum's avatar
      File ctor should take StringPiece. · e20eed09
      Yedidya Feldblum authored
      Summary: [Folly] File ctor should take StringPiece.
      
      This way we can use it with `std::string` and `folly::fbstring` a touch more easily.
      
      Reviewed By: @luciang
      
      Differential Revision: D2235870
      e20eed09
  3. 13 Jul, 2015 4 commits
  4. 09 Jul, 2015 6 commits
    • Joe Richey's avatar
      Added default value for filter's predicate argument · 91343de6
      Joe Richey authored
      Summary: After discussion with Tom about frozen files, we noticed that the use
      case of filtering out somthing that looks like false (0, nullptr, folly::none)
      is unnecessarily tedious. So folly::gen::filter now filters by the value of
      the item by default.
      
      Reviewed By: @ddrcoder
      
      Differential Revision: D2220582
      91343de6
    • Subodh Iyengar's avatar
      Add mocks for isBufferMovable · c78afbd2
      Subodh Iyengar authored
      Summary: Add mocks for the new isBufferMovable methods.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2222642
      c78afbd2
    • Yedidya Feldblum's avatar
      ThreadedExecutor. · 7cb1a017
      Yedidya Feldblum authored
      Summary: [Folly] ThreadedExecutor.
      
      It's an Executor that runs functions each in its own thread.
      
      Kind of simple. Suitable for a few types of strange cases.
      
      Reviewed By: @​hannesr
      
      Differential Revision: D2226211
      7cb1a017
    • Tudor Bosman's avatar
      Add isManaged / makeManaged · 58059b6e
      Tudor Bosman authored
      Summary: Add a way to tell whether an IOBuf (either indvidually or the whole chain)
      refers to memory that's outside of IOBuf's control (via WRAP_BUFFER). That is,
      can you assume that clone() will extend the lifetime of the memory? Is it safe
      to use clone() instead of copying the data (and avoid a copy)?
      
      Reviewed By: @simpkins
      
      Differential Revision: D2191883
      58059b6e
    • Steve O'Brien's avatar
      folly/singleton: fatal in unrecoverable error cases · 6caa6956
      Steve O'Brien authored
      Summary: Early in the startup process there may not be a default signal handler installed, and stack traces are not available; also during the startup process is when init-order fiascos occur.  Dump a stacktrace and fatal when an unregistered singleton is used.
      
      Also fatals -- with glog `LOG(FATAL)`, which triggers an ABRT signal -- on other illegal and unrecoverable usage like double-registration or circular dependency.
      
      Reviewed By: @andriigrynenko
      
      Differential Revision: D2200408
      6caa6956
    • Mark McDuff's avatar
      high init priority for FiberManagerMap data · bf52653d
      Mark McDuff authored
      Summary: Ran into a bug in D2158570 where we dtor'ing these data structures before the event bases destructed, so the assert on line 47 (of the old code) failed.
      
      Reviewed By: @andriigrynenko
      
      Differential Revision: D2198318
      bf52653d
  5. 07 Jul, 2015 6 commits
    • Sara Golemon's avatar
      Bump version to 49:1 · 28f7b88b
      Sara Golemon authored
      28f7b88b
    • Alexey Spiridonov's avatar
      Install Ubuntu 12.04 LTS dependencies for Travis CI · b160fd7b
      Alexey Spiridonov authored
      Summary: This is the first of a series of diffs to get folly, fbthrift, and bistro to run on Ubuntu 12.04 LTS, which is what powers Travis CI.
      
      It's important for folly to be easily usable with Travis CI, since everything C++ depends on it, and we really want all FB open-source projects to be monitored via continuous integration to avoid breaking their OSS builds.
      
      Thanks to @int's work on `mcrouter`, this was considerably easier than it would have been otherwise.
      
      This puts us a hop and a skip away from actually running folly's `make && make check && make install` on Travis CI. Do y'all think this is useful?
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2217441
      b160fd7b
    • Sara Golemon's avatar
      Bump version to 49:0 · 67f639c0
      Sara Golemon authored
      67f639c0
    • James Sedgwick's avatar
      folly/wangle -> wangle cutover · 0f383c37
      James Sedgwick authored
      Summary: Another stab at D2111063 now that we have the go ahead to actually open up the wangle github repo
      
      Reviewed By: @djwatson, @mdordal
      
      Differential Revision: D2178291
      0f383c37
    • Philip Pronin's avatar
      cleanup CompressedList / MutableCompressedList interfaces · 29cfa7b7
      Philip Pronin authored
      Summary: Drop those `const_cast<>` hacks.
      
      Reviewed By: @ot
      
      Differential Revision: D2217629
      29cfa7b7
    • Hans Fugal's avatar
      folly/futures Update README.md · c286b93a
      Hans Fugal authored
      Summary: This is a documentation dump, with updates from the past couple weeks. Most notably, the new information about `Future<Unit>` replacing `Future<void>`.
      
      Reviewed By: @​hannesr
      
      Differential Revision: D2211135
      c286b93a
  6. 02 Jul, 2015 7 commits
  7. 01 Jul, 2015 3 commits
    • Hans Fugal's avatar
      Future<Unit> global fixup · 812f803c
      Hans Fugal authored
      Summary: This is three codemods:
      
      * `(folly::(Future|Promise|Try))<void>` -> `\1<folly::Unit>`
      * `(Future|Promise|Try)<void>` -> `\1<Unit>`
      * add `using folly::Unit` statements where needed
      
      Then
      * undo false positives in javascript files and fibers::Promise
      
      cf D2201259, which this will land with
      
      Reviewed By: @djwatson
      
      Differential Revision: D2201801
      812f803c
    • Hans Fugal's avatar
      Future<Unit> wangle fixup · 98a8a89d
      Hans Fugal authored
      Summary: Mostly this is `s/(Promise|Future|Try)<void>/\1<Unit>/`
      
      Reviewed By: @djwatson
      
      Differential Revision: D2201272
      98a8a89d
    • Hans Fugal's avatar
      Nuke Future<void> (folly/futures) · e845ef57
      Hans Fugal authored
      Summary: Nuke Future<void> in favor of Future<Unit>, for the `folly/futures` subdirectory.
      
      Reviewed By: @djwatson
      
      Differential Revision: D2201259
      e845ef57