1. 12 Nov, 2019 2 commits
  2. 11 Nov, 2019 2 commits
  3. 10 Nov, 2019 1 commit
  4. 09 Nov, 2019 2 commits
  5. 08 Nov, 2019 2 commits
    • Lara Lu's avatar
      make ExecutorWithPriority's priority changeable · f59ddd8c
      Lara Lu authored
      Summary:
      We need the ability to dynamically change the priority of an executor when it's executing work. Specifically, we want to de-prioritize a query's work units while it is being executed if it has taken up too much resources.
      Pass a callback function to ExecutorWithPriority which sets the priority upon every add.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D18344806
      
      fbshipit-source-id: c0c59d3982637703e6e7c3793930b9d9fadce6fe
      f59ddd8c
    • Dan Melnic's avatar
      Add folly::hardware_concurrency · a1c28139
      Dan Melnic authored
      Summary:
      Add folly::hardware_concurrency
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D18342219
      
      fbshipit-source-id: 806ef7b46e52896fa289a79854e45447929ab632
      a1c28139
  6. 07 Nov, 2019 5 commits
    • Chad Austin's avatar
      ensure folly uses no deprecated entities · 7e195929
      Chad Austin authored
      Summary:
      In preparation for adding a deprecation annotation to
      Synchronized::operator->, ensure that folly builds deprecation-clean.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D18351118
      
      fbshipit-source-id: f90a230d24a95e3983989d2c3caf7a4383a8226a
      7e195929
    • Felix Handte's avatar
      IOBuf: Fix Bug in Cloning with Headroom and Tailroom · 2b501f7f
      Felix Handte authored
      Summary:
      If the source IOBuf is not chained, we short-circuit the cloning logic and
      instead share the existing buffer. This works when we implicitly require the
      clone to have the same headroom and tailroom requirements as the source
      IOBuf. However, the API allows setting other values. We need to test that we
      meet those requirements in order to use the shortcut. This diff adds those
      checks.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D18180574
      
      fbshipit-source-id: 31bfaabd7663cf83faf919d8cb242df0a7a2969d
      2b501f7f
    • Abhinav Rai's avatar
      Fix tests for ExecutorLoopController timer. · 802676ff
      Abhinav Rai authored
      Summary:
      Using a ThreadPoolExecutor instead of calling getCPUExecutor() to get one.
      getCPUExecutor() by default returns an inline executor, which doesn't ensure that sleep is triggered on the same executor as the fiber loop.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D18353758
      
      fbshipit-source-id: 6810d11b12de3f62ac5286dba00d2b4a9d447eba
      802676ff
    • John Strizich's avatar
      remove libnl depedency from open source build · a76c883b
      John Strizich authored
      Summary: We removed this dependency in the code a while ago.
      
      Reviewed By: saifhhasan
      
      Differential Revision: D18366401
      
      fbshipit-source-id: daf1c7865fe0c312694bdf395f9d7ace99f70395
      a76c883b
    • Shai Szulanski's avatar
      Enable KeepAlive support in ScopedEventBaseThread · bf4793bd
      Shai Szulanski authored
      Reviewed By: yfeldblum
      
      Differential Revision: D18356211
      
      fbshipit-source-id: ad2361c65260a1a09f8536d07e5447cfcf5cc552
      bf4793bd
  7. 06 Nov, 2019 3 commits
    • Maged Michael's avatar
      experimental: Add single writer multi-reader fixed hash map · 85d753b7
      Maged Michael authored
      Summary:
      Add a fixed single-writer multi-reader hash map that supports:
      - Copy construction with optional expansion
      - Concurrent read-only lookup.
      - Concurrent read-only iteration.
      
      The map has fixed size. Higher-level users can manage instances of this map to build a more general unbounded map.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D17522603
      
      fbshipit-source-id: b4fcfe427a343f7226d216670536f2594f187bf3
      85d753b7
    • Bo Dong's avatar
      Change Benchmark UserCounter to 64 bit int · 975dc0f9
      Bo Dong authored
      Summary: Change UserCounters to 64bit integer to fit big counters like cpu_cycle counting.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D18249661
      
      fbshipit-source-id: 7808ef51e7230aa929ed555ed837ba5dd1962944
      975dc0f9
    • Xiaofei Du's avatar
      Delete Coro.Throw test · d3676acb
      Xiaofei Du authored
      Summary: Coro.Throw and Coro.FutureThrow are exactly the same. Delete one
      
      Reviewed By: lewissbaker
      
      Differential Revision: D18337140
      
      fbshipit-source-id: 9cf479b3e33599b3c8c982cabc87d1227d4efb9b
      d3676acb
  8. 05 Nov, 2019 3 commits
    • Maged Michael's avatar
      RequestContext: Add microbenchmarks · b6641eb7
      Maged Michael authored
      Summary: Add microbenchmarks for request context operations.
      
      Reviewed By: LeeHowes
      
      Differential Revision: D17434204
      
      fbshipit-source-id: 22c804d71b922dd6894bdf6d98449f0c60c83206
      b6641eb7
    • Genevieve Helsel's avatar
      add pwritevNoInt and preadvNoInt to FileUtil · 08c318db
      Genevieve Helsel authored
      Summary: Adds `pwritevNoInt()` and `preadvNoInt()` to FileUtil.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D18213230
      
      fbshipit-source-id: 0dfcd19ecf4500aa2bba279800d65821309371c6
      08c318db
    • Yedidya Feldblum's avatar
      invoke_traits · 82ca15c5
      Yedidya Feldblum authored
      Summary: [Folly] `invoke_traits`, which can take an invoker and make a traits type that has member traits that look like the std's invoke traits.
      
      Reviewed By: vitaut
      
      Differential Revision: D18082562
      
      fbshipit-source-id: 9cfaf1a43fd695a23f7eb30d28a3c8aaaf2b9b60
      82ca15c5
  9. 04 Nov, 2019 3 commits
    • Abhinav Rai's avatar
      Add timeout support in ExecutorLoopController. · 99e8fc1f
      Abhinav Rai authored
      Summary:
      Add timeout support to python executor. Executor uses a separate thread running a folly event base.
      Whenever a timer operation is called, scheduleTimeout is executed in that event base.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D18201883
      
      fbshipit-source-id: 337518bea52993461201d6706f438130673ef6ce
      99e8fc1f
    • Dan Melnic's avatar
      Add iouring folly support, refactor the async IO · 60da8ef5
      Dan Melnic authored
      Summary: Add iouring folly support, refactor the async IO
      
      Reviewed By: kevin-vigor
      
      Differential Revision: D17834511
      
      fbshipit-source-id: e20c876a32730549f305334fd5eed02cccf23638
      60da8ef5
    • Bo Dong's avatar
      remove the namespace dependency of BENCHMARK_COUNTERS · b35bea8f
      Bo Dong authored
      Summary: BENCHMARK_COUNTERS tests need to set `using folly::UserCounters` or `using namespace folly`. Add absolute namespace path in the macro to get rid of this requirement.
      
      Reviewed By: Orvid
      
      Differential Revision: D18271700
      
      fbshipit-source-id: 084041142b7c245e3c861943570416ac89ea6c34
      b35bea8f
  10. 02 Nov, 2019 1 commit
  11. 01 Nov, 2019 5 commits
    • Luca Wehrstedt's avatar
      Support non-byte and non-1d memoryviews when converting to IOBufs · 8718c37f
      Luca Wehrstedt authored
      Summary:
      Using `shape[0]` as the length of the IOBuf means using the number of _elements_ along the first dimension, rather than the total number of bytes in the memoryview. Thus
      - if the element size is not 1 byte, this will get only a fraction of the memory;
      - if the memoryview is shapeless, the code will segfault;
      - if the memoryview is multidimensional, it will only get a fraction of the memory (and, if the memory is C-contiguous, it will be an odd slice: in a 2x3 memoryview, it will get the entire first row and half of the second).
      
      Perhaps the above was intentional, but I believe that when converting a shaped and typed object to an unshaped and untyped buffer, it's more intuitive to ignore the type and size and just look at the memory backing it.
      
      I also added a check to ensure the view is contiguous. IOBufs can't represent a non-contiguous buffer, except by using a chain, which however in this case could have an arbitrary unbounded length, making it unadvisable. Alternatively we could copy the memory, but this is probably not what the user would expect. Disallowing this seems the safest option.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D18006273
      
      fbshipit-source-id: f21dbb462266eee68f1a5ce0ecea85b1a46e0a8b
      8718c37f
    • David Carlier's avatar
      FreeBSD build fix regarding native parts. · 328ab26d
      David Carlier authored
      Summary: Pull Request resolved: https://github.com/facebook/folly/pull/1248
      
      Reviewed By: yfeldblum
      
      Differential Revision: D18094432
      
      Pulled By: Orvid
      
      fbshipit-source-id: 115afedc62be8881941cfb4d0e02748be349763f
      328ab26d
    • Amol Bhave's avatar
      create unorderedReduceSemiFuture method · 9b2ba17c
      Amol Bhave authored
      Summary:
      create a unorderedReduceSemiFuture method that returns a SemiFuture
      instead of just a Future.
      
      Reviewed By: mhlakhani
      
      Differential Revision: D18248163
      
      fbshipit-source-id: ba1f8ede93c95ea0b877ac306056e7e38c4452e6
      9b2ba17c
    • Chad Austin's avatar
      enable -Wunused-exception-parameter · 1966558d
      Chad Austin authored
      Summary:
      Build folly with -Werror and -Wunused-exception-parameter to prevent
      them from sneaking back in.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D18232483
      
      fbshipit-source-id: 7154d3dfec6c672aa3aa46299456bd3c4d757709
      1966558d
    • Luca Niccolini's avatar
      windows build · 323cd710
      Luca Niccolini authored
      Summary: ^
      
      Reviewed By: mjoras
      
      Differential Revision: D18256970
      
      fbshipit-source-id: 4d07b961ab5ab145b620d9e10fa67116236bbf80
      323cd710
  12. 31 Oct, 2019 2 commits
    • Mingtao Yang's avatar
      ssl: Only invoke RAND_poll on older versions of OpenSSL · af0d320e
      Mingtao Yang authored
      Summary:
      Only do RAND_poll on older versions of OpenSSL.
      
      RAND_poll is not required on OpenSSL 1.1.0+, as the RNG is implicitly seeded. On OpenSSL 1.1.1., RAND_poll became aliased to RAND_add. With some custom RNG implementations that did not implement RAND_add, (e.g. python-cryptography's osrandom implementation), this would manifest as a failure.
      
      Reviewed By: ngoyal, yfeldblum
      
      Differential Revision: D16786271
      
      fbshipit-source-id: 4fb7876525006517c3e554d70736d7071bd3b4e3
      af0d320e
    • Matt Ma's avatar
      Change QMS iterator to take const QMS* in constructor. · 73c65d44
      Matt Ma authored
      Summary: The functions in QMS are all marked as const already.
      
      Reviewed By: philippv
      
      Differential Revision: D18240371
      
      fbshipit-source-id: 113f5c968207f0a4ff9b780cd43de43cb90f758b
      73c65d44
  13. 30 Oct, 2019 3 commits
    • Mikhail Shatalov's avatar
      Removed unnecessary cast · 55cb92ef
      Mikhail Shatalov authored
      Summary: Floating-point scale conversion doesn't require a cast
      
      Reviewed By: yfeldblum
      
      Differential Revision: D18052505
      
      fbshipit-source-id: 3d87a916da5cec03b23041908066a9862fab6fde
      55cb92ef
    • Felix Handte's avatar
      Check Compression Context Pool Doesn't Return nullptr · 9aea2092
      Felix Handte authored
      Summary:
      Minor improvements to the CompressionContextPool. Although it should be
      impossible, this diff checks that we do not retrieve `nullptr`s out of the
      stack.
      
      I also threw in a quick refactor to not store a copy of the deleter in the
      RTPDeleter.
      
      Reviewed By: terrelln
      
      Differential Revision: D18131791
      
      fbshipit-source-id: eda1856720fdb86a69ee0a2a867b25bb20ebc319
      9aea2092
    • Sermet Iskin's avatar
      Add peer name auth (i.e. server auth) support to AsyncSSLSocket through SSLContext · d9d30843
      Sermet Iskin authored
      Summary:
      This change adds basic support for server auth through AsyncSSLSocket and fills in the implementation under SSLContext::authenticate() to support peer name verification.
      
      virtual void SSLContext::authenticate(
            bool checkPeerCert,
            bool checkPeerName,
            const std::string& peerName = std::string());
      
      SSLContext::authenticate signature has parameters intended for server-auth scenarios, but it doesn't have an implementation underneath it and silently ignores the checkPeerName and peerName parameters. This change implements the intended behavior through OPENSS's SSL_set1_host. The intended behavior is as follows:
      * When checkPeerName is false, the behavior is unchanged and this should cover all existing use cases.
      * When checkPeerName is true, either the peerName or the servername (suppled through the AsyncSSLSocket constructor) in this given order is expected to be present in the SAN or CN of the peer's certificate as described in [the OPENSSL documentation](https://www.openssl.org/docs/man1.1.0/man3/SSL_add1_host.html). Socket will error our if neither name is supplied. Wildcard matching when checking the name is intentionally disabled for now since there is no known need for it at the moment.
      
      Unit tests are added to cover both positive and negative scenarios around SSL server name auth.
      
      Reviewed By: mingtaoy
      
      Differential Revision: D18162775
      
      fbshipit-source-id: d275f5e2e9e760895c27ba9d73cf8b6a2d0ff599
      d9d30843
  14. 28 Oct, 2019 6 commits
    • Yedidya Feldblum's avatar
      Use cacheline_aligned in LifoSem · f4fb4266
      Yedidya Feldblum authored
      Summary: [Folly] Use simpler `cacheline_aligned` v.s. `CachelinePadded` in `LifoSem`, per comments atop `CachelinePadded`.
      
      Reviewed By: aary
      
      Differential Revision: D18166262
      
      fbshipit-source-id: 807c668666fbbc9c16d5f449fa20234e56b29042
      f4fb4266
    • Kyle Nekritz's avatar
      Handle close_notify as standard writeErr in AsyncSSLSocket. · c321eb58
      Kyle Nekritz authored
      Summary: Fixes CVE-2019-11934
      
      Reviewed By: mingtaoy
      
      Differential Revision: D18020613
      
      fbshipit-source-id: db82bb250e53f0d225f1280bd67bc74abd417836
      c321eb58
    • Giuseppe Ottaviano's avatar
      Improve EliasFanoCodingTest coverage of 64-bits values and corner cases · df7b6652
      Giuseppe Ottaviano authored
      Summary: `EliasFanoCoding` is used with 64-bits values in some logic, but we have no tests for that. Also, we weren't testing the larges admissible value. Finally, clarify in the comments what the various size types are for.
      
      Reviewed By: philippv
      
      Differential Revision: D18146549
      
      fbshipit-source-id: e97ec9e1344db6e56a591a9b4c77c5929e10b22b
      df7b6652
    • generatedunixname89002005287564's avatar
      Remove dead includes in folly/functional · acf4b746
      generatedunixname89002005287564 authored
      Reviewed By: Orvid
      
      Differential Revision: D18169787
      
      fbshipit-source-id: 1580df251c9ae87e9c268f1599d8c61232b48a4d
      acf4b746
    • Yedidya Feldblum's avatar
      Use attribute-based suppression in free-invoke traits · fd84bde1
      Yedidya Feldblum authored
      Summary: [Folly] Use attribute-based suppression in free-invoke traits v.s. pragma-based suppression for suppressing warnings about unused functions.
      
      Reviewed By: vitaut
      
      Differential Revision: D18112966
      
      fbshipit-source-id: 2519f94d4ff4609c8418d4fd009a24acefe23ab2
      fd84bde1
    • Yedidya Feldblum's avatar
      Remove classname from free-invoke traits inner names · 00319abe
      Yedidya Feldblum authored
      Summary: [Folly] Remove `classname` from free-invoke traits inner names - it's already present for disambiguation in the outer private namespace name. Also adjust some of the names better to fit a singular pattern.
      
      Reviewed By: vitaut
      
      Differential Revision: D18112947
      
      fbshipit-source-id: 0a3e76a72a16fff7d4c127c2994a8c38639083e2
      00319abe