1. 27 Oct, 2015 2 commits
    • Shaft Wu's avatar
      Track callback life cycle for HHWheelTimer and EventBase · 47f0d384
      Shaft Wu authored
      Summary: Further race is presented in HHWheelTimer and EventBase, since changing them to track callback life cycle is more involving, I am hacking around it to prove the concept. With the *fix*, no reproduce of the segmentation fault anymore.
      
      This is for proving the concept, code will be cleaned up if we agree this is reasonable direction to pursue.
      
      Reviewed By: fugalh
      
      Differential Revision: D2577715
      
      fb-gh-sync-id: e0bb0317268e6f02a54fc70454e63959fba70c10
      47f0d384
    • Jun Li's avatar
      Expose pending messages in queue stats in AsyncServerSocket · 28c5ca58
      Jun Li authored
      Summary: Expose pending messages in accept queue in AsyncServerSocket.
      
      Set default accept message queue size to 1024.
      
      Reviewed By: djwatson
      
      Differential Revision: D2525161
      
      fb-gh-sync-id: a69ea0ee77729e4a8300bde3e3c07840f2d5d3cb
      28c5ca58
  2. 26 Oct, 2015 5 commits
    • Lucian Grijincu's avatar
      folly: hash: specialize hash_combine_generic by size_t size · 59527d6a
      Lucian Grijincu authored
      Reviewed By: yangliu
      
      Differential Revision: D2578043
      
      fb-gh-sync-id: cec8f21219655a495b99d0b6b99f0925615bc068
      59527d6a
    • Florent Thoumie's avatar
      Add new toBinary() function to IPAddress. · fa9cc998
      Florent Thoumie authored
      Summary: This is pretty much the reverse operation from the fromBinary() constructor.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D2578680
      
      fb-gh-sync-id: d8c4e53fe8bc0f5373ebb0b4f7ee498659c1b003
      fa9cc998
    • Yedidya Feldblum's avatar
      Style nits for folly/test/FingerprintBenchmark.cpp · e56b41ec
      Yedidya Feldblum authored
      Summary: [Folly] Style nits for `folly/test/FingerprintBenchmark.cpp`.
      
      Reviewed By: Gownta
      
      Differential Revision: D2579463
      
      fb-gh-sync-id: 135bc3ef43708cb024f78c59672811159d2163e0
      e56b41ec
    • Mohammad Husain's avatar
      Rename two callback function names of ConnectionEventCallback · 22f86ef7
      Mohammad Husain authored
      Summary: Renaming `EnqueuedForAccept` and `DequeuedByAccept` to
      `EnqueuedForAcceptor` and `DequeuedByAcceptor` respectively to make it clear
      that the connection is queued for the Acceptor not to call `accept` on.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D2554578
      
      fb-gh-sync-id: 072a9ff122658827d1e89f2bef79ad565dad7974
      22f86ef7
    • Shijin Kong's avatar
      return read error on non EAGAIN errno · 209397bd
      Shijin Kong authored
      Summary: Tested over weekend with D2571554. There was no EXC_RESOURCE/CPU crash when read errrors were returned on ENOTCONN. EAGAIN seems innocent as the spin detector was disabled on testing group.
      
      Patch folly. I can add #ifdef __APPLE__ around the errno checking code but this should be good practice for non apple code as well.
      
      I will remove debugging code in fbios master in another diff.
      
      Reviewed By: djwatson
      
      Differential Revision: D2580819
      
      fb-gh-sync-id: 9162a3deba01af8b07cd2b336d7da3da040c67a9
      209397bd
  3. 24 Oct, 2015 1 commit
    • Nathan Bronson's avatar
      fix AtomicUnorderedInsertMap load factor computation · 6b17defc
      Nathan Bronson authored
      Summary: AtomicUnorderedInsertMap's constructor takes a maxLoadFactor argument,
      which is given its default argument of 0.8f in all of our code.
      The clipping function that was supposed to prevent load factors
      greater than one was inverted, resulting in all of our code using a
      maxLoadFactor of 1 instead of 0.8.  This diff fixes the computation,
      as well as changing all of the use sites so that the actual memory
      allocated by existing clients does not change.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D2575238
      
      fb-gh-sync-id: bb9dd8de53114236b259631d175d62af098391cf
      6b17defc
  4. 23 Oct, 2015 3 commits
    • Jon Maltiel Swenson's avatar
      Fibers allocation/deallocation benchmarks · bc857f03
      Jon Maltiel Swenson authored
      Summary: Add a couple benchmarks measuring allocation/deallocation latency.  One benchmark measures an allocate-deallocate repeated pattern, the other measures the allocation of a large chunk of fibers.
      
      We'll use these benchmarks later on after we modify the allocation/deallocation behavior of fibers.
      
      Reviewed By: pavlo-fb
      
      Differential Revision: D2573064
      
      fb-gh-sync-id: 414eb93d6223e42c187c03214a47dfb533491bab
      bc857f03
    • Bartosz Nitka's avatar
      Option to fallback to double when int precision is not enough. · a3bfe5b0
      Bartosz Nitka authored
      Summary: Some libraries like Haskell's `Data.Aeson` can produce arbitrarily
      big numbers with arbitrary precision.
      The json standard doesn't specify the ranges for numeric types.
      For interoperability, we should allow the user to parse the numbers with
      some loss of precision.
      
      Reviewed By: luciang
      
      Differential Revision: D2565140
      
      fb-gh-sync-id: b1a9a46e298bf13cc89d7e79ce28705e9e251a7f
      a3bfe5b0
    • Nathan Bronson's avatar
      templatize AtomicUnorderedInsertMap's internals to allow big maps · d0889c8c
      Nathan Bronson authored
      Summary: AtomicUnorderedInsertMap used 32 bit index values internally.  2 bits
      were stolen, limiting the capacity to 2^30.  This diff makes the internal
      index type a template parameter, so you can make really big maps if you
      want (at the expense of bigger map overhead).  The easiest way is to
      substitute AtomicUnorderedInsertMap64.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D2574338
      
      fb-gh-sync-id: a74994b6da1046a149c2e7763c3dc19e35d9840b
      d0889c8c
  5. 22 Oct, 2015 3 commits
    • Alan Frindell's avatar
      Fix infinite loop in Cursor::readTerminatedString · 69f3c942
      Alan Frindell authored
      Summary: readTerminatedString could infinite loop if the terminator does not appear in the contained IOBuf chain and maxLength > chain.computeChainLength.  I'm throwing out_of_range here because that more closely mirrors what the other read() functions do.
      
      Reviewed By: siyengar
      
      Differential Revision: D2571039
      
      fb-gh-sync-id: 1db22089562d8767920d66a0a1b091b02de6571f
      69f3c942
    • Giuseppe Ottaviano's avatar
      Clang support for constexpr StringPiece constructor · d1027eb2
      Giuseppe Ottaviano authored
      Summary: Clang's `strlen` is not `constexpr`, but `__builtin_strlen` is, so we can have an unconditional `constexpr` `StringPiece` constructor.
      
      Reviewed By: luciang, yfeldblum
      
      Differential Revision: D2561782
      
      fb-gh-sync-id: 51e76a0d50355cc5ead1148ba2389b640a6888de
      d1027eb2
    • Yaacov Akiba Slama's avatar
      Fix gcc 5.2 compilation when _GLIBCXX_USE_CXX11_ABI is not 0 · 50b33d29
      Yaacov Akiba Slama authored
      Summary: Tested in debian stretch when used in hhvm which can now run drupal 7.
      The compilation error is also fixed by #214 but this fix maintains
       forward declarations of basic_string and list.
      Closes https://github.com/facebook/folly/pull/329
      
      Reviewed By: yfeldblum
      
      Differential Revision: D2533880
      
      fb-gh-sync-id: 85e18eeeba9efa1b4150217ba526b32b5573e15e
      50b33d29
  6. 21 Oct, 2015 5 commits
  7. 20 Oct, 2015 1 commit
  8. 17 Oct, 2015 2 commits
    • Bruno Goncalves's avatar
      Remove boost dependency from folly/ProducerConsumerQueue.h · ef011843
      Bruno Goncalves authored
      Summary: Boost is great, but c++11 incorporate some of their stuffs, and classes like ProducerConsumerQueue don't need it anymore.
      Closes https://github.com/facebook/folly/pull/321
      
      Reviewed By: fredemmott, yfeldblum
      
      Differential Revision: D2519081
      
      fb-gh-sync-id: b138a5af4662d1e7ef5e0823cf4001880ee02456
      ef011843
    • Ranjeeth Dasineni's avatar
      Change NotificationQueue assert -> CHECK · f640f4bb
      Ranjeeth Dasineni authored
      Summary: If the eventFd goes bad, NotificationQueue consumers can cause their event loop to spin indefinitely.  If libevent gets POLLERR on the fd, it calls handlerReady, which triggers a read.  The read will fail, but the callback is never uninstalled.  I'm not sure it would be easy to recover gracefully from this, so crash hard instead.
      
      Reviewed By: yfeldblum, pgriess
      
      Differential Revision: D2550270
      
      fb-gh-sync-id: c9575fbda778b3625da6d9db6b0542b8263f230a
      f640f4bb
  9. 16 Oct, 2015 11 commits
  10. 15 Oct, 2015 4 commits
    • Kyle Nekritz's avatar
      Add framework for switching certs based on signature_algorithms TLS extension. · f7176051
      Kyle Nekritz authored
      Summary: Added support for switching SSLContexts based on the signature_algorithms
      extension.
      This diff does not currently include any logic for determining which certs use
      SHA1 or not.
      
      Some thoughts:
      - This is a little scary since it defaults to SHA1 (assuming the client can't support
      SHA256 if we don't see SHA256 specifically in the hello extension). We need to
      be 100% sure that all clients that are going to reject SHA1 are sending this,
      and that we identify it correctly.
      - We should add logging to see when we think a client needs SHA1, when we
      actually give SHA1, etc. I'm not sure what the best way to do this is with our
      logging infrastructure.
      - This is not setup to serve any SHA1 certs to SHA256 supporting clients.
      
      Reviewed By: @siyengar
      
      Differential Revision: D2408773
      
      fb-gh-sync-id: 48ad9cdfaae25e144c0964b9bfb1c342b137ffca
      f7176051
    • Yedidya Feldblum's avatar
      Fix Build: under GCC 4.9 + ASAN, RangeSse42.cpp fails to build · c942721a
      Yedidya Feldblum authored
      Summary: [Folly] Fix Build: under GCC 4.9 + ASAN, `RangeSse42.cpp` fails to build.
      
      Reviewed By: @ldemailly, @meyering
      
      Differential Revision: D2544284
      
      fb-gh-sync-id: fd50f8b326252291ad3a5d9fe956e7e647ad0133
      c942721a
    • Subodh Iyengar's avatar
      Add handshake and connect times · 18435bce
      Subodh Iyengar authored
      Summary: Add api to get time taken to establish
      connections and to complete handshake
      for clients using AsyncSocket directly.
      
      Reviewed By: @afrind
      
      Differential Revision: D2435074
      
      fb-gh-sync-id: f44c336e62c426736eb5b3d88dd57a18572382e8
      18435bce
    • Subodh Iyengar's avatar
      Ephemeral ciphers in false start list · ae574fb9
      Subodh Iyengar authored
      Summary: Only include ephemeral ciphers in false start list.
      
      Reviewed By: @​mzlee
      
      Differential Revision: D2429447
      
      fb-gh-sync-id: 430d287a93249ff72b9ebe7db3bc283bb0712600
      ae574fb9
  11. 14 Oct, 2015 2 commits
  12. 13 Oct, 2015 1 commit