1. 24 Sep, 2020 1 commit
    • Maged Michael's avatar
      hazptr: Clarify warning about reclamation executor · 92fe7260
      Maged Michael authored
      Summary:
      Change WARNING to INFO because there are cases where not using a dedicated thread pool is the right choice. INFO still provides the debugging benefit if the lack of dedicated thread pool indeed leads to deadlock.
      
      Clarify that the likely cause for the message about the reclamation executor is that the program did not call folly::enable_hazptr_thread_pool_executor which is called by folly::init.
      
      Reviewed By: yfeldblum, joshkehn
      
      Differential Revision: D23826463
      
      fbshipit-source-id: a5906ee974b5fe87c2d38dcff9a0f2717afb2a5c
      92fe7260
  2. 23 Sep, 2020 4 commits
    • Rahul Tekawade's avatar
      Fix Traits `folly::IsOneOf` document typo · 09cfcf96
      Rahul Tekawade authored
      Summary: Fix document typo for `folly::IsOneOf` (see diff)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23863254
      
      fbshipit-source-id: 02f64a72decab028be832f71e1132dfce7fe5fa9
      09cfcf96
    • Chad Austin's avatar
      enable symbolizer on any platform with backtrace(3) · c0938b8a
      Chad Austin authored
      Summary:
      Now that symbolizer has precise feature flags, enable
      FOLLY_USE_SYMBOLIZER on any platform that has backtrace(3), which is
      all that's needed to get a useful stack trace printed in the signal
      handler.
      
      Reviewed By: yfeldblum, luciang
      
      Differential Revision: D23361609
      
      fbshipit-source-id: b124f7fd01e94f90d8f8586555a64bd6e412040c
      c0938b8a
    • Dan Melnic's avatar
      Allow changing the Sleeper sleep interval · d7736cff
      Dan Melnic authored
      Summary: Allow changing the Sleeper sleep interval
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23591682
      
      fbshipit-source-id: 81b55fa699362d62e436c599c38046d15fecee37
      d7736cff
    • Zhaodong Wang's avatar
      Return erased size in erase_if · 0a1b471e
      Zhaodong Wang authored
      Summary:
      To have parity with C++20 `std::erase_if`: https://en.cppreference.com/w/cpp/container/unordered_set/erase_if
      
      Added a return value for `folly::erase_if` for the number of the removed elements.
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23779631
      
      fbshipit-source-id: cea42b90557dd570db8e010d68c2b9ecf0bcc515
      0a1b471e
  3. 22 Sep, 2020 5 commits
    • Nick Terrell's avatar
      Fix 1-byte heap overrun · cfd29074
      Nick Terrell authored
      Summary: Fix 1-byte buffer overrun when parsing the string "\t".
      
      Reviewed By: mhlakhani
      
      Differential Revision: D22931605
      
      fbshipit-source-id: a90d0a64b882ed8fef96285d47e11fa082178449
      cfd29074
    • Andrii Grynenko's avatar
      Fix builds on windows · ef52bd9a
      Andrii Grynenko authored
      Summary:
      Move ContextPrimaryPtr definition outside of the function.
      Rename MasterPtr to PrimaryPtr.
      
      Reviewed By: Orvid
      
      Differential Revision: D23836006
      
      fbshipit-source-id: d2ad229809fb260c485a7349eca7378e22dc66c4
      ef52bd9a
    • Andrii Grynenko's avatar
      Unwrap Observer<Observer<T>>> · 39e09616
      Andrii Grynenko authored
      Differential Revision: D23829791
      
      fbshipit-source-id: 4a13cd70f20de487ece11a1eada94467e1700b6e
      39e09616
    • Michael Lee (Engineering)'s avatar
      Check the value of `FOLLY_USE_JEMALLOC` instead of assuming defined · 0e94731b
      Michael Lee (Engineering) authored
      Summary:
      To be able to override this feature, we should check that
      `FOLLY_USE_JEMALLOC` is set to 1 rather than just set.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D22681072
      
      fbshipit-source-id: 18b35910217fd1869cc23107a50241c4ed2ed1b7
      0e94731b
    • Chad Austin's avatar
      only build exception_tracer on elf platforms with libdwarf · c43ba39c
      Chad Austin authored
      Summary: FOLLY_USE_SYMBOLIZER is too coarse of a flag to determine whether ExceptionTracer is available. Instead, use FOLLY_HAVE_ELF and FOLLY_HAVE_DWARF.
      
      Reviewed By: yfeldblum, luciang
      
      Differential Revision: D23361407
      
      fbshipit-source-id: 2326f185c98f58e7afb007befc9121a365c22e77
      c43ba39c
  4. 21 Sep, 2020 2 commits
  5. 19 Sep, 2020 1 commit
  6. 18 Sep, 2020 7 commits
  7. 17 Sep, 2020 5 commits
    • Lukas Piatkowski's avatar
      getdeps: update zstd to 1.4.5 · a590a0e5
      Lukas Piatkowski authored
      Reviewed By: krallin
      
      Differential Revision: D23757084
      
      fbshipit-source-id: 7e49228805e272064ad52d43141b5815eba4190a
      a590a0e5
    • Yedidya Feldblum's avatar
      Always enable fiber support in futures · dfed6248
      Yedidya Feldblum authored
      Summary:
      [Folly] Always enable fiber support in futures.
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D19229519
      
      fbshipit-source-id: f0a034e9387c5ccad676a911213fab74364ca340
      dfed6248
    • Lewis Baker's avatar
      Add co_awaitTry() support to AsyncGenerator · bdd4cbe1
      Lewis Baker authored
      Summary:
      Add the ability for an AsyncGenerator to yield an error without needing to throw an exception and for consumers to retrieve the error without rethrowing the exception.
      
      Added a new `folly::coro::co_error` type that acts as a simple wrapper around a `folly::exception_wrapper` that can be used to indicate that this value is an error.
      
      This allows `AsyncGenerator` bodies to now `co_yield` a `co_error` as a way of completing with an error without needing to throw the exception.
      
      For example:
      ```
      class SomeError : public std::exception { ... };
      folly::coro::AsyncGenerator<int> example() {
        co_yield 42;
        co_yield folly::coro::co_error(SomeError{});
      }
      ```
      
      This diff also adds support for `folly::coro::co_awaitTry()` to the `AsyncGenerator::next()` method.
      
      For example:
      ```
      folly::coro::Task<void> consumer() {
        folly::coro::AsyncGenerator<int> gen = example();
        folly::Try<int> result =
          co_await folly::coro::co_awaitTry(gen.next());
        // use result
      }
      ```
      
      Added a benchmark to compare performance of the new interfaces vs the existing throwing-based error handling.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D18015926
      
      fbshipit-source-id: 27d2e16e7dde9b4c871846f5d17b40ec3737330a
      bdd4cbe1
    • Lee Howes's avatar
      r-value qualify Future::getVia for consistency with other get operations · 3153b1b0
      Lee Howes authored
      Summary: getVia is destructive like other forms of get. This change r-value qualifies it to highlight that in code.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23603722
      
      fbshipit-source-id: d2aecac3c6eb09e0fcf55a07e310114ebc13b932
      3153b1b0
    • Dan Melnic's avatar
      Add support for polling the io_uring submission/completion queues · 3a2cecf1
      Dan Melnic authored
      Summary: Add support for polling the io_uring submission/completion queues
      
      Reviewed By: kevin-vigor
      
      Differential Revision: D23566444
      
      fbshipit-source-id: 7f8331d1f34db78dc4bca4aea3e5f5a1c8f00023
      3a2cecf1
  8. 16 Sep, 2020 3 commits
    • Yedidya Feldblum's avatar
      Tweak partial to avoid macos build failure · 802e8f7a
      Yedidya Feldblum authored
      Summary:
      [Folly] Tweak `partial` to avoid a poorly-understood build failure on macos with clang++ and libc++.
      
      ```
      In file included from folly/functional/test/PartialTest.cpp:19:
      In file included from folly/folly/Function.h:230:
      folly/functional/Invoke.h:65:25: error: attempt to use a deleted function
            noexcept(noexcept(std::mem_fn(f)(static_cast<A&&>(a)...)))
                              ^
      folly/functional/Partial.h:41:19: note: in instantiation of exception specification for 'operator()<int (int &, int &, int &), Foo, const Foo &, const int &, const int &, int &>' requested here
            -> decltype(invoke(
                        ^
      folly/functional/Partial.h:65:56: note: while substituting deduced template arguments into function template 'invokeForward' [with Self = const folly::detail::partial::Partial<int (Foo::*)(int &, int &, int &), std::__1::tuple<Foo, int, int> > &, I = <0, 1, 2>, Args = <int &>]
        auto operator()(CArgs&&... cargs) const& -> decltype(invokeForward(
                                                             ^
      folly/functional/test/PartialTest.cpp:59:21: note: while substituting deduced template arguments into function template 'operator()' [with CArgs = <int &>]
        EXPECT_EQ(1234, p0(four));
                          ^
      type_traits:1743:5: note: '~__nat' has been explicitly marked deleted here
          ~__nat() = delete;
          ^
      ```
      
      Reviewed By: chadaustin
      
      Differential Revision: D23722804
      
      fbshipit-source-id: 7b3d6307a46fa12eadea13db327f10aafb89691c
      802e8f7a
    • Xavier Deguillard's avatar
      portability: define uid_t and gid_t · 7c35c2be
      Xavier Deguillard authored
      Summary:
      The getuid and getgid are defined as returning uid_t and gid_t. Defining these
      types here will prevent downstream consumer from having to redefine these
      types for Windows.
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: yfeldblum, Orvid
      
      Differential Revision: D23693492
      
      fbshipit-source-id: 1ec9221509bffdd5f6d241c4bc08d7809cdb6162
      7c35c2be
    • Luca Niccolini's avatar
      only install googletest 1.8 when building tests · 383456d7
      Luca Niccolini authored
      Summary: no need to install when not building tests
      
      Reviewed By: wez
      
      Differential Revision: D23714375
      
      fbshipit-source-id: 6f34ab59ed2155df5646ad279d1347e904f393c4
      383456d7
  9. 15 Sep, 2020 6 commits
    • Yedidya Feldblum's avatar
      Cache python-import in getExecutor · 841d5087
      Yedidya Feldblum authored
      Summary: [Folly] Cache python-import in `getExecutor` so that it happens only once overall rather than once per call.
      
      Reviewed By: nanshu
      
      Differential Revision: D23657508
      
      fbshipit-source-id: 06d3bd53303cac9c10fff74f4e6daaeccdc59471
      841d5087
    • Luca Niccolini's avatar
      googletest 1.8.0 · 3fdcf359
      Luca Niccolini authored
      Summary: required. not installed with CMake ExternalProject anymore
      
      Reviewed By: xttjsn
      
      Differential Revision: D23700095
      
      fbshipit-source-id: 807105a1e3d4bd837a35e39c6dced53744edd8de
      3fdcf359
    • Luca Niccolini's avatar
      enable tests in getdeps · 9f72af22
      Luca Niccolini authored
      Summary:
      in getdeps we currently don't build and run the tests
      There are a few issues:
        1. we need to also build tests for fizz, wangle, mvfst since proxygen tests include headers only exported if building tests in dependencies
        2. we use `ExternalProject_add` for gtest/gmock. but doesn't seem to be playing nicely with getdeps
      
      Reviewed By: dddmello, mjoras
      
      Differential Revision: D16934955
      
      fbshipit-source-id: fb1c52237f9f0c71da86643409972c94d16e6a71
      9f72af22
    • Luca Niccolini's avatar
      enable tests in getdeps · 7bb0963b
      Luca Niccolini authored
      Summary: properly find the required GMock version (1.8.0) and allow building tests in getdeps
      
      Reviewed By: mjoras
      
      Differential Revision: D16935741
      
      fbshipit-source-id: 46f62511e2feaf553d028e286a862aa5b30393c6
      7bb0963b
    • Luca Niccolini's avatar
      enable tests in getdeps · 35cb6568
      Luca Niccolini authored
      Summary: also always install fizz test headers for mvfst and proxygen tests to consume without needing to build fizz tests
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23676344
      
      fbshipit-source-id: 7ae78c81c2d67bb8da135fcd69d4be119b50a27e
      35cb6568
    • Luca Niccolini's avatar
      fizz, mvfst, wangle, proxygen: add gmock as fbcode_build dependency · 0e50cd03
      Luca Niccolini authored
      Summary: they were all transitively pulling it from folly
      
      Reviewed By: mjoras
      
      Differential Revision: D23683292
      
      fbshipit-source-id: 2085a580584891b3fd0960c14505c0f675a11bd5
      0e50cd03
  10. 14 Sep, 2020 5 commits
    • Sotirios Delimanolis's avatar
      Add a CertificateIdentityVerifier to AsyncSSLSocket · 25e3fd32
      Sotirios Delimanolis authored
      Summary:
      This diff introduces a callback, `CertificateIdentityVerifier` that can probe peer end-entity certificates during a TLS handshake in `AsyncSSLSocket`.
      
      The verifier gets called only if regular chain verification (OpenSSL's and a `HandshakeCB`'s) succeeds and can return a `Try` with a `CertificateIdentityVerifierException` to indicate that a failure occurred. `AsyncSSLSocket` will then fail the TLS handshake.
      
      The diff also adds a new `AsyncSSLSocket` constructor with a new `Options` parameter that groups together some optional properties, including the verifier. We can eventually refactor the other constructors to use it too.
      
      Reviewed By: mingtaoy
      
      Differential Revision: D22821714
      
      fbshipit-source-id: b63b141862b5703eb5274fb6ef8aa98934a55df0
      25e3fd32
    • Chad Austin's avatar
      fix exception_tracer build on macOS · 0666e8d5
      Chad Austin authored
      Summary:
      exception_tracer is currently gated on FOLLY_USE_SYMBOLIZER, and when
      I enabled it, I didn't notice the CMake build of Folly on macOS
      stopped working.
      
      Fix it by adding correct conditionals, and removing the removed
      std::unexpected_handler.
      
      Reviewed By: yfeldblum, lnicco
      
      Differential Revision: D23690777
      
      fbshipit-source-id: 76ada7911ac33de3b1e8b0a73cebf3c2d04a58ef
      0666e8d5
    • Songqiao Su's avatar
      release write buffer before calling write callback · cd60da45
      Songqiao Su authored
      Summary: As the main purpose of write callback is to signal the buffer is on longer needed and may be released (https://fburl.com/diffusion/ahbbb6oy). Release the buffer then calling the write callback seems more reasonable
      
      Differential Revision: D23411380
      
      fbshipit-source-id: c9b421716368253eafb4ecb8b72f48c8b47c2f9f
      cd60da45
    • Stepan Palamarchuk's avatar
      Introduce EventBase::Options · 3d5e5974
      Stepan Palamarchuk authored
      Summary:
      This API allows for an easier way to configure EventBase without a need to introduce yet another constructor with variable amount of arguments.
      
      In particular, we have an ad-hoc constructor for overriding just the wheel timer interval, but it's not possible to override it in other constructors.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23511659
      
      fbshipit-source-id: 2f8de3a527ee07dbf2dc19f2e369014793d906c1
      3d5e5974
    • Luca Niccolini's avatar
      add gtest version 1.8 · 8f60f633
      Luca Niccolini authored
      Summary:
      needed by a few projects [wangle, mvfst, proxygen]
      
      it's already in lfs
      https://www.internalfb.com/intern/diffusion/FBS/browse/master/fbcode/tools/lfs/.lfs-pointers?lines=41
      
      Reviewed By: mzlee
      
      Differential Revision: D23676343
      
      fbshipit-source-id: 0fa04d4224f27e756f683924af0c21ea63a90647
      8f60f633
  11. 13 Sep, 2020 1 commit
    • Lee Howes's avatar
      Enforce r-value use of Future::getVia · 72a5d49c
      Lee Howes authored
      Summary:
      Fixes across the codebase to allow for r-value qualified getVia.
      
      Change is behaviour neutral - getVia is already destructive internally.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23605722
      
      fbshipit-source-id: 75dfe6faca1c888eae9b262552372dd557eb6933
      72a5d49c