- 21 May, 2020 3 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Tweak `BlockingContext` in various ways. Differential Revision: D21657789 fbshipit-source-id: 4b03b3b43dddc0e9011a7594001994f2594a1a5b
-
Yedidya Feldblum authored
Summary: [Folly] Lock utilities: `upgrade_lock`, `transition_to_shared_lock`, `transition_to_upgrade_lock`, `transition_to_unique_lock`, `try_transition_to_unique_lock`. Note: `std::shared_mutex` does not have an upgrade state or any atomic transitions; there is no `std::upgrade_lock`; and `std::shared_lock` does not have a constructor from `std::unique_lock`. Reviewed By: simpkins, nbronson Differential Revision: D15532568 fbshipit-source-id: d32f387b26b57539857922c3090dc75ffcaaa538
-
Lee Howes authored
Summary: Migration from Future-returning executor-erasing collectX forms to SemiFuture-returning forms, that are less risky in particular with coroutines. Earlier changes added collectXSemiFuture and collectXUnsafe as a migration path. We then migrated collectX callsites to collectXSemiFuture or collectXUnsafe and switched the implementation of collectX to the SemiFuture form. This diff removes collectXSemiFuture completely. Reviewed By: yfeldblum, mpark Differential Revision: D21631886 fbshipit-source-id: c7b296d51f30c8b51ab0c7d06b1ce62c8cdd28d5
-
- 20 May, 2020 9 commits
-
-
Ian Petersen authored
Summary: `folly::detail::OptionalPromise<Value>` won't build with exceptions turned off (e.g. by passing `-fno-exceptions` on Clang's command line) because its `unhandled_exception()` says `throw;`. This diff replaces the `throw;` with a call to `folly::rethrow_current_exception();`. Reviewed By: yfeldblum Differential Revision: D21655976 fbshipit-source-id: 5f431372f2494a09f98e3b8c36a94e8475efff29
-
Bryan Alger authored
Summary: This fails to build on win32 platform with: ``` xplat\folly\portability\pthread.cpp(142): error C2664: 'HANDLE CreateThread(LPSECURITY_ATTRIBUTES,SIZE_T,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD)': cannot convert argument 3 from 'DWORD (__cdecl *)(void *)' to 'LPTHREAD_START_ROUTINE' ``` This seems to fix it. Reviewed By: Orvid Differential Revision: D21623386 fbshipit-source-id: 1b18a74bd71ffc75f34a92074e07f3d69742c07d
-
Yedidya Feldblum authored
Summary: [Folly] Small simplification of `AsyncSocket` read loop. Differential Revision: D21514325 fbshipit-source-id: 0af27205b4aa2807a800430e8a2b3dea36356970
-
Dan Melnic authored
Summary: Add io_uring_submit_and_wait call Reviewed By: yfeldblum Differential Revision: D21653382 fbshipit-source-id: 945aa877a30b3c6431089a113ece5999d1217eb4
-
Matt Ma authored
Reviewed By: yfeldblum, luciang Differential Revision: D21656746 fbshipit-source-id: 5e19d72ccd524926c698b8814cc6c8f2c6133565
-
Dan Melnic authored
Summary: fsync the temp file Reviewed By: yfeldblum, kevin-vigor Differential Revision: D21668049 fbshipit-source-id: 85825f81dfbe10a452f7f946133bb3d8993850f8
-
Yedidya Feldblum authored
Summary: [Folly] `rethrow_current_exception`, a `-fno-exceptions` compatibility wrapper for `throw;`. Reviewed By: ispeters Differential Revision: D21656269 fbshipit-source-id: 8f37fe71c6255162b8f05268cae04ac5927013d7
-
Nick Terrell authored
Summary: gcc-6.5 on OS X <= 10.6 complains about the `\r` when this code path is enabled. I don't think we officially support `__i386__`, but I want to backport the patch from zstd. https://github.com/facebook/zstd/pull/1418 (Note: this ignores all push blocking failures!) Reviewed By: yfeldblum, Orvid Differential Revision: D13104652 fbshipit-source-id: 737a68253c7d90c3a1cc026069b048551cb5ced9
-
Adam Simpkins authored
Summary: If an error is thrown when formating arguments for a log message, use `folly::exceptionStr()` to format the exception instead of just `ex.what()`. I changed all of the tests that verify the results of these strings to use a regular expression, as `folly::exceptionStr()` produces different results in different platforms, and does not always demangle type names. I also included a minor change to increase a timeout in AsyncFileWriterTest.cpp, as I saw this timeout fail spuriously once in my testing. Reviewed By: yfeldblum Differential Revision: D21635680 fbshipit-source-id: 749ef48deb59af1f2faef0158e0291838e09fc38
-
- 19 May, 2020 7 commits
-
-
Matt Ma authored
Summary: Fix the issue that there may be other tags like DW_TAG_lexical_block between DW_TAG_subprogram and DW_TAG_inlined_subroutine. Also increase the maximum inline location info per frame since previous value 3 is too small. Refactors the code to set file and line for inline functions. Reviewed By: luciang Differential Revision: D21250080 fbshipit-source-id: f52dc74ee5c144aa26723546b48486f8a5250f19
-
Dan Melnic authored
Summary: Fix uninitialized maxSubmit_, maxGet_ member variables Reviewed By: danobi Differential Revision: D21645171 fbshipit-source-id: 094ba7b045010954fdebc249318191f956f5b7b2
-
Adam Simpkins authored
Summary: This updates the logging code so that it is possible to include `folly/xlog.h` and write log statements in code that is compiled with `-fno-exceptions` The code for parsing log configuration strings does still use exceptions in some of its config parsing logic. It shouldn't be too difficult to disable that in a subsequent diff, but for now this change at least makes it possible for calling code to write log messages. Reviewed By: yfeldblum Differential Revision: D21630914 fbshipit-source-id: ce9ed422f40066e57433a85182e1a8fc6d8628db
-
Robin Cheng authored
Summary: This fixes a race condition detected by ThreadSanitizer. The thread list is protected by a mutex, but individual structs in the list are not protected, leading to racy access to two of their fields. This diff makes the fields atomic. Reviewed By: yfeldblum Differential Revision: D21484748 fbshipit-source-id: a981419f47a2aebaf1d40b23e9c4967cf2104aaa
-
Dan Melnic authored
Summary: Remove PollIoBackend inline submit Reviewed By: danobi Differential Revision: D21625033 fbshipit-source-id: 02ee55e64a2538c6a2392ea70912f4ae9b642963
-
Lee Howes authored
Summary: The current stack trace formatting is based on repeated string appends with newlines. This change adds more control so that we can produce file and line information only, without unnecessary newlines. New format: ./folly/experimental/symbolizer/Symbolizer.h:77 ./folly/experimental/symbolizer/test/StackTraceTest.cpp:209 ./folly/experimental/symbolizer/test/StackTraceTest.cpp:213 ./folly/experimental/symbolizer/test/StackTraceTest.cpp:258 Reviewed By: yfeldblum Differential Revision: D21562670 fbshipit-source-id: 7d05605cbda686e2f1c87577647c7ab7581f8580
-
Kirk Shoop authored
Summary: adds ensureCleanupAfterTask() takes a SemiFuture<T> task and a SemiFuture<Unit> cleanup. returns a SemiFuture<T> always starts cleanup after task completes. stores the result of the task and replays it after the cleanup completes. cleanup is not allowed to fail. Reviewed By: yfeldblum, andriigrynenko Differential Revision: D21481825 fbshipit-source-id: 901a91c25f7b2b4fa794a590a5433e0fad27d168
-
- 18 May, 2020 1 commit
-
-
Luqun Lou authored
Summary: CpuLocalBuffer need extend alignment, which isn't honored by std::vector's default allocator due to compiler bug http://open-std.org/JTC1/SC22/WG21/docs/papers/2012/n3396.htm https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65122 https://bugs.llvm.org/show_bug.cgi?id=22634 the fix is to use custom allocator to honor extend alignment requirement. Reviewed By: yfeldblum Differential Revision: D21405041 fbshipit-source-id: 53cfe1bfd66580990c8a1a0c5f0c09f6651bda24
-
- 17 May, 2020 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Fill `reentrant_allocator` member types and functions for situations which fail to indirect via `std::allocator_traits`, such as the former implementation of libstdc++ `std::basic_string`. May help to address https://github.com/facebook/fboss/issues/86. Differential Revision: D21608091 fbshipit-source-id: 020ac3bd37b27a08dd7c8113a77979d0ba21a8fc
-
- 15 May, 2020 4 commits
-
-
Misha Shneerson authored
Summary: Allows attaching a BPF script to observe tasks behavior Sample script, attaching those probes to a test binary (./buck-out/gen/common/services/cpp/test/thrift_2_async_server) is provided. Reviewed By: yfeldblum Differential Revision: D21526163 fbshipit-source-id: e976ddada1921c8c904d65aa9a558bbb45bf158f
-
Lewis Baker authored
Summary: Adds a new CoInvoke() helper function that should be used instead of ::testing::Invoke() when defining mock methods using coroutine lambdas. Use of Invoke() in a GMock definition that calls a coroutine-lambda that contains captures will result in the returned Task holding a dangling reference to a copy of the lambda. The CoInvoke() helper instead, ensures that the coroutine created by the lambda holds on to a reference to a copy of the lambda that is kept alive until the coroutine completes by invoking the lambda using the folly::coro::co_invoke() utility function instead of directly calling operator(). Reviewed By: andriigrynenko Differential Revision: D21578404 fbshipit-source-id: 3322740efd00596c2311530a166ef2d5301c6b89
-
Wez Furlong authored
Summary: I'm doing this mostly so that we can avoid using git to fetch the sources. Reviewed By: chadaustin Differential Revision: D21508201 fbshipit-source-id: 54d4635d8938659bea962e90bd829d237f1ed221
-
Wez Furlong authored
Summary: We use drive letter substitutions to workaround Windows filename length limitations. On my personal Windows system running python 3.8.2 realpath inside an ssh session manages to resolve to the full filename which causes the boost build to fail. Avoid that! Reviewed By: chadaustin Differential Revision: D21507851 fbshipit-source-id: 1220c1c85d2124ddc51f42cefff2ce00e10c55c9
-
- 14 May, 2020 3 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Avoid inlining `Cursor` slow paths. These are already extracted to separate functions, but the compiler will still aggressively inline them. Differential Revision: D21392842 fbshipit-source-id: 2b045ae9c5188315b938de984730ad2051237cf5
-
Andrew Huang authored
Summary: Giving SSLContext ownership over the new session callback attached to SSL_CTX, so that it may do additional work with the new session (i.e. forward the session to its corresponding abstracted SSLSession). Reviewed By: mingtaoy Differential Revision: D21478165 fbshipit-source-id: 459e4b3f9af2fedee4c02df6c9f689db15c1852f
-
Dan Melnic authored
Summary: Avoid calling scheduleTimeout for a thread that is mostly busy Reviewed By: yfeldblum Differential Revision: D21531280 fbshipit-source-id: b89254ebc3662c951b3b181b3a2777afb9e3f4fe
-
- 13 May, 2020 2 commits
-
-
Matt Joras authored
Summary: As it turns out, to use this reliably on Android we need to define a weak symbol. The headers are only exported after API level 21, so apps that compile with 16 cannot use it with a compile time flag. Instead we can utilize a weak symbol to link with it, and check if it's there at runtime. Reviewed By: yfeldblum Differential Revision: D21535034 fbshipit-source-id: 8b68a803d1e9f2f293e9f3efa16fb2a18abee53d
-
Yedidya Feldblum authored
Summary: [Folly] Explicitly enforce that `RequestToken` is trivially-destructible to permit its use as a Meyers Singleton without requiring the use of Leaky Meyers Singleton to avoid destruction-order problems. (Note: this ignores all push blocking failures!) Differential Revision: D21533605 fbshipit-source-id: fe334fd5257b1d0a07efd849c4532b28801e54c4
-
- 12 May, 2020 3 commits
-
-
Christopher Wei authored
Summary: Adds a version of getFiberManager that takes a VirtualEventBase + FrozenOptions Reviewed By: yfeldblum Differential Revision: D21507009 fbshipit-source-id: 2bffd1704650b25e78fc388b3e033da4f2c16b9a
-
Matt Joras authored
Summary: It needs to set the msg_len, otherwise the caller doesn't know how long the datagram is. Reviewed By: yangchi Differential Revision: D21512788 fbshipit-source-id: f24c2bd9e86acf93ebf12c48afcf7658c8e8d54e
-
Dan Melnic authored
Summary: Fix sendmmsg wrapper Reviewed By: yfeldblum Differential Revision: D21513176 fbshipit-source-id: ddc1bdd93801136994ef62fd5793da7371e9e22a
-
- 11 May, 2020 4 commits
-
-
Spencer Baumgardner authored
Summary: This diff adds support for reference types to the Async abstraction. One example use-case is memoization where you generate the value asynchronously on cache-miss. You want may want to return a reference to avoid the expense of copying. Some additional context is in D21438851. Reviewed By: yfeldblum Differential Revision: D21478238 fbshipit-source-id: 53e1b997abed2d40f0a2f9ab935925ad9bbc91ab
-
JiaJie Ye authored
Summary: VirtualEventBase is backed by a EventBase and byitself is also sequenced, thus shoudl be an SequencedExecutor (Note: this ignores all push blocking failures!) Reviewed By: yfeldblum Differential Revision: D21493098 fbshipit-source-id: 97fd09161117e77422a5786584db89af98dfe314
-
Xavier Deguillard authored
Summary: For large projects, with lots of tests, running all the tests can take a lot of time, but for quick development iteration, only a subset of the tests may be needed to run. On non-Windows platforms, this can be easily achieved by manually executing the individual tests binaries and use the builtin filtering mechanism of that test binary to achieve the goal. On Windows, this can quickly become impossible as DLLs might not be available, and the right PATH would need to be manually specified by hand to execute the tests binaries[0]. To solve this, let's simply provide a unified way of running specific tests by passing in a regexp. Both testpilot and CTest do support regex to execute specific tests. My understanding is that cargo doesn't yet allows regex, but will in the future. [0]: And a missing DLLs would produce no output when executed from PowerShell, which makes this very confusing. Reviewed By: wez Differential Revision: D21484774 fbshipit-source-id: ee32e950e25bb2a498a2b364a447955a917b0590
-
Ian Petersen authored
Summary: Sized deallocation (introduced in C++14) is only available on iOS after 10.0. This diff changes `folly_coro_async_free` to use `operator delete(void*)` when `operator delete(void*, size_t)` is unavailable. Reviewed By: yfeldblum Differential Revision: D21492467 fbshipit-source-id: 2afef1d3d2aa6c70fec5f49e5d62a4a594e6da83
-
- 10 May, 2020 1 commit
-
-
Andrii Grynenko authored
Summary: Otherwise its possible to hit a collision with another code that's using unsafe getFiberManager API. Reviewed By: yfeldblum Differential Revision: D21492532 fbshipit-source-id: 52577a284f80e4d7b7e730adde24812e53702c29
-
- 09 May, 2020 1 commit
-
-
Xavier Deguillard authored
Summary: Previously, the Windows build was litered with warnings of the form (typo included): warning C4250: 'C1': inherits 'C2::C2::method' via dominance note: see declaration of 'C2::method' Microsoft doesn't offer any recommendation, and the internet suggest that the right `using` should silence it. That's unfortunately not the case, adding: using C2::method In `C1` doesn't do anything, and the compiler still complains :(. Since the warning appears to be non-actionable, and looks more like a "notice" than a warning, let's just silence it. Reviewed By: wez Differential Revision: D21395095 fbshipit-source-id: ae661b3ed61303e6361b8a15d9e7c6b9627ea8c1
-
- 08 May, 2020 1 commit
-
-
Wez Furlong authored
Summary: A small number of hosts are impacted by some local misconfiguration like this: ``` ccache /usr/bin/c++ -DHAVE_PCLMUL -DHAVE_SSE42 -DOS_LINUX -DROCKSDB_FALLOCATE_PRESENT -DROCKSDB_LIB_IO_POSIX -DROCKSDB_MALLOC_USABLE_SIZE -DROCKSDB_NO_DYNAMIC_EXTENSION -DROCKSDB_PLATFORM_POSIX -DROCKSDB_PTHREAD_ADAPTIVE_MUTEX -DROCKSDB_RANGESYNC_PRESENT -DROCKSDB_SCHED_GETCPU_PRESENT -DROCKSDB_SUPPORT_THREAD_LOCAL -DSNAPPY -I/var/sandcastle/temp/fbcode_builder_getdeps/extracted/rocksdb-v6.8.1.tar.gz/rocksdb-6.8.1 -I/var/sandcastle/temp/fbcode_builder_getdeps/extracted/rocksdb-v6.8.1.tar.gz/rocksdb-6.8.1/include -I/var/sandcastle/temp/fbcode_builder_getdeps/extracted/rocksdb-v6.8.1.tar.gz/rocksdb-6.8.1/third-party/folly -isystem /var/sandcastle/temp/fbcode_builder_getdeps/extracted/rocksdb-v6.8.1.tar.gz/rocksdb-6.8.1/third-party/gtest-1.8.1/fused-src -isystem /var/sandcastle/temp/fbcode_builder_getdeps/installed/snappy-8kzrVQJKWlYwtUKTyQTv0R3_bltgjXecrUEMwSpi-vI/include -W -Wextra -Wall -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -Wno-strict-aliasing -std=c++11 -fno-omit-frame-pointer -momit-leaf-frame-pointer -fno-builtin-memcmp -O2 -g -DNDEBUG -MD -MT CMakeFiles/rocksdb.dir/cache/lru_cache.cc.o -MF CMakeFiles/rocksdb.dir/cache/lru_cache.cc.o.d -o CMakeFiles/rocksdb.dir/cache/lru_cache.cc.o -c /var/sandcastle/temp/fbcode_builder_getdeps/extracted/rocksdb-v6.8.1.tar.gz/rocksdb-6.8.1/cache/lru_cache.cc ccache: error: /home/facebook/.ccache/ccache.conf: No such file or directory ``` let's try to avoid it! Reviewed By: simpkins Differential Revision: D21460408 fbshipit-source-id: 95b1fe019ff36eb8acb8476af997c220a7947436
-