- 14 Feb, 2021 1 commit
-
-
Dan Melnic authored
Summary: Move REGISTER_TYPED_TEST_CASE_P to cpp from h Reviewed By: yfeldblum Differential Revision: D26440651 fbshipit-source-id: 7efd63b2f4af3de206cf2abdba33c849145c7834
-
- 13 Feb, 2021 2 commits
-
-
Dan Melnic authored
Summary: Avoid static init crash in testing::internal::TypedTestCasePState::VerifyRegisteredTestNames when compiling with clang 9.0 (works OK with clang-8.0) Reviewed By: yfeldblum Differential Revision: D26419675 fbshipit-source-id: c961ac0f73e3fc8d8852eb32c0b89634fb854c37
-
Ilya Maykov authored
Summary: See title. Reviewed By: yfeldblum Differential Revision: D26419855 fbshipit-source-id: 2857c80eb2500d8d3d5f815a1f795ddeac31165f
-
- 12 Feb, 2021 4 commits
-
-
Samuel Miller authored
Summary: This allows the test client to be used with session tickets enabled, if desired Reviewed By: yfeldblum Differential Revision: D25795104 fbshipit-source-id: 1adfb6c17c6da24db9c6367485a5cd0f8e534661
-
Kevin Vigor authored
Summary: Existing API allows user to specify a single preferred CPU for SQ_POLL workers, but it also allows specifying multiple workers. Add API to allow specifying a set of CPUs, not just one. The specified set of CPUs are used in round-robin fashion, so it is not strictly necessary that the number of CPUs and the number of workers be the same. #forceTDHashing Reviewed By: yfeldblum Differential Revision: D26380317 fbshipit-source-id: ecfd8722670ffc3e3dc246fae1bcb7f4d8e6f3e4
-
Dan Melnic authored
Summary: Lower max submit so the test will not fail with EINVAL when SQ size is > CQ size Reviewed By: kevin-vigor Differential Revision: D26419746 fbshipit-source-id: f9cbd4bef06b314f43ab667646d9e5ef61999246
-
Ilya Maykov authored
Summary: See title Reviewed By: knekritz Differential Revision: D26320388 fbshipit-source-id: 2796ae36cd8779f56474d21e89e80562f7bad22d
-
- 11 Feb, 2021 7 commits
-
-
Yedidya Feldblum authored
Summary: The `AsyncGenerator` test for `co_safe_point` immediately-invokes a temporary coroutine function to return a coroutine object, but the temporary coroutine function goes out of scope while the returned coroutine is live. Use `co_invoke` to fix it. Reviewed By: lxfind Differential Revision: D26408345 fbshipit-source-id: 4650ea57c01baffb1065560b661e3296cb0292cc
-
Robert Quitt authored
Summary: The new version of googletest has a different internal API for registering test suites. This diff updates `CO_TEST_` to match the new version of googletest. I created this diff by copying the new version of `GTEST_TEST_` and adding the coroutine `co_TestBody`, just like in the old version of `CO_TEST_`. ~~There is a problem that I'd like reviewer's feedback on: how do we cleanly make the switch over to the new version of `CO_TEST_`? This change is tied to a specific version of googletest.~~ ~~I have 2 ideas so far:~~ ~~(Plan 1) Land this diff stacked on top of D25585021, so that we don't have to manage two versions at once.~~ Not possible (Plan 2) Have two versions of `CO_TEST_` at the same time, but select which one to use based on a preprocessor macro defined in gtest. Reviewed By: yfeldblum Differential Revision: D26365504 fbshipit-source-id: 196c2277c7942163951f5781b334d0bff5c34de8
-
Scott Pruett authored
Summary: Some use-cases of AsyncPipe may want to backpressure writers in the case that readers start to slow down. Without backpressure, the queue (and pending work) can essentially grow without bound, leading to OOMs or starvation of other resources. This implements a bounded channel primitive by layering a semaphore in front of an existing AsyncPipe. It inherits similar cancellation behavior, though pending writes must be canceled in the case that the read end is destroyed. Reviewed By: iahs Differential Revision: D26260278 fbshipit-source-id: a936cf021023b31a6db868e27e9855480a1dc405
-
Dan Melnic authored
Summary: Add io_uring SQ/CQ poll tests Reviewed By: yfeldblum Differential Revision: D26387632 fbshipit-source-id: 2b68fa4f9af41b76b90183a010f81a92537a6e3f
-
Victor Zverovich authored
Summary: Remove `BaseFormatter::fbstr()` because it is virtually unused and those few cases that do use it are better off with `std::string`. Reviewed By: yfeldblum Differential Revision: D26358276 fbshipit-source-id: e96b4958735b3c9c03010e1e3dcdd01abd2d6a33
-
Yedidya Feldblum authored
Summary: Let the function passed to `EventBaseLocal::getOrCreateFn` directly return the value to be stored, rather than allocating it and returning a pointer. Details of its storage should be internal to `EventBaseLocal` and should not leak out into the creator functions. Differential Revision: D26246341 fbshipit-source-id: d72a62998985e42ef517eede3654324dc9f48709
-
Victor Zverovich authored
Summary: Remove `folly::writeTo` which is untested and virtually unused, replacing ``` folly::writeTo( stdout, folly::format(...)); ``` with ``` fmt::print(...); ``` for better compatibility with C++20 `std::format`. Reviewed By: yfeldblum Differential Revision: D26326405 fbshipit-source-id: 598ec5d7906b2d36b20aa63f410a0c2621bc62fa
-
- 10 Feb, 2021 3 commits
-
-
Jakob lövhall authored
Summary: removed double of word 'lock' Pull Request resolved: https://github.com/facebook/folly/pull/1523 Reviewed By: yfeldblum Differential Revision: D26367154 Pulled By: Orvid fbshipit-source-id: 586647d28b9ad002ee975450426d2da967dc638e
-
Shai Szulanski authored
Summary: There are lots of unnecessary uses of shared_ptr for type erasure where refcounting is not needed because it is trivial to convert to shared_ptr<void>, while it is more involved to make the equivalent unique_ptr. Adds a utility that hides the details to bring effort parity between the two pointer types. Reviewed By: yfeldblum Differential Revision: D26323443 fbshipit-source-id: e33c5378f7df3105c7cb97d2622dca351b866035
-
Dan Melnic authored
Summary: Add IoUringBackend support for openat, openat2, close, fallocate #forcetdhashing Reviewed By: kevin-vigor Differential Revision: D26325604 fbshipit-source-id: dbeea468ffbb324dc8c7afc1dbde1e451f72e06d
-
- 09 Feb, 2021 7 commits
-
-
Alfred Fuller authored
Summary: Making it consistent with other *OnNextLine rules. Also fixes really odd line breaks after the return type of some functions, for example: ``` template <typename M> iterator insert_or_assign(const_iterator /*hint*/, key_type const& key, M&& obj) { ``` becomes: ``` template <typename M> iterator insert_or_assign( const_iterator /*hint*/, key_type const& key, M&& obj) { ``` Reviewed By: yfeldblum Differential Revision: D25987579 fbshipit-source-id: cc24ea3db1b256f5563fb051fbd572adfccf556a
-
Xavier Deguillard authored
Summary: On macOS, ninja only provides prebuilt Intel binaries, not arm64 ones. Since we need to have a native arm64 ninja to be able to build binaries for the M1, let's compile it from scratch on macOS too. Compiling it takes less than 30s so it shouldn't add any notable cost to any builds. Reviewed By: genevievehelsel Differential Revision: D26322029 fbshipit-source-id: 1bbeeac2a3f0ba07c477a2b33f8878a91ccaec0e
-
Shai Szulanski authored
Summary: Combining CancellationTokens is a common pattern in user code, which requires the user to manage a CancellationSource and attach a callback per token to be merged: ``` folly::CancellationSource source; folly::CancellationCallbacki cb1{ std::move(token1), [&] { source.requestCancellation(); }}; folly::CancellationCallback cb2{ std::move(token2), [&] { source.requestCancellation(); }}; ... co_await co_withCancellation(source.getToken(), ...); ``` This diff adds the functionality to folly: ``` co_await co_withCancellation(folly::CancellationToken::merge(token1, token2, ...), ...); ``` This diff subclasses CancellationState for simplicity. If the extra vtable ptr is a concern, we can instead template CancellationState to combine them, but that would come with a compilation speed penalty. Reviewed By: yfeldblum Differential Revision: D26277772 fbshipit-source-id: 169f65b4cf8f7f10f2800fb7797bb09379ecc239
-
Yedidya Feldblum authored
Summary: Fix the uncaught-exception termination message expectations in `folly/lang/ExceptionTest.cpp` under libc++. Reviewed By: markisaa Differential Revision: D26328622 fbshipit-source-id: 2e2f9fce93c65556508d99d1f7b80f0971f35c0c
-
Dan Melnic authored
Summary: Lower min capacity so the test succeeds when ulimit -l has a lower value Reviewed By: yfeldblum Differential Revision: D26321362 fbshipit-source-id: 9d2c41fbbc190f46a6174c3f847943e13f5bea6c
-
Victor Zverovich authored
Summary: Removed deprecated folly format APIs. Reviewed By: yfeldblum Differential Revision: D26317507 fbshipit-source-id: 67f42d059088946a34e77c944befa4dcb24d8673
-
Xavier Deguillard authored
Summary: I've been trying to get EdenFS to compile on an M1 mac, and openssl only support these starting with 1.1.1i. From their changelog: *) Add support for Apple Silicon M1 Macs with the darwin64-arm64-cc target. [Stuart Carnie] Let's start by upgrading openssl. Reviewed By: fanzeyi Differential Revision: D26318433 fbshipit-source-id: dfe1a06ee7061dfcd026b0347eb050155895ebd9
-
- 07 Feb, 2021 1 commit
-
-
Yedidya Feldblum authored
Summary: Reexport `coroutine_handle` from `folly/experimental/coro/Coroutine.h`, which wraps inclusion of `experimental/coroutine`. Differential Revision: D26227588 fbshipit-source-id: 32cdb2b6d87e90065bf9f140716d63670c04db5f
-
- 06 Feb, 2021 3 commits
-
-
Alex Snast authored
Summary: Similar to XLOG_EVERY_MS but for formatted messages. Reviewed By: yfeldblum Differential Revision: D26296133 fbshipit-source-id: 92d2e240d70cf40b903f19b0350c6d9cc0daa1fb
-
Andrii Grynenko authored
Differential Revision: D26265450 fbshipit-source-id: 0cefa65feb3fc3b76c1b8b8a9059dc4d321c6751
-
Mikhail Shatalov authored
Summary: ...to avoid additional `get()` call if we need the emplaced object right after. Reviewed By: yfeldblum Differential Revision: D26238594 fbshipit-source-id: a66396173a27ac684b403b3c0c576be50c39dde2
-
- 05 Feb, 2021 9 commits
-
-
Mikhail Shatalov authored
Summary: `getOrCreateFn()` is prone to undefined behavior as it returns `nullptr` reference if factory function returns a `nullptr` or empty `std::shared_ptr<T>`, or if `emplace(evb, nullptr)` is called. This diff adds `DCHECK`s to enforce non-nulls. Note that `getOrCreate()` is not affected as it uses `std::make_shared` under the hood that is guaranteed to have a new object constructed. Differential Revision: D26246552 fbshipit-source-id: b7bc7164841b70fc0889c782438bf96a61857bbd
-
Xavier Deguillard authored
Summary: EdenFS has a use-case for this macro but with 10+ arguments. Raise the maximum number of arguments from 7 to 15 to permit this. Reviewed By: yfeldblum Differential Revision: D26268587 fbshipit-source-id: be0b0579d854a93dc2983706a253370fe05905df
-
Dan Melnic authored
Summary: Add support for io_uring min capacity. This should allow us to create io_uring instances even memory is fragmented and the kernel cannot allocate contiguous physical memory for capacity CQ entries (SQ is usually much smaller). Reviewed By: kevin-vigor Differential Revision: D26252442 fbshipit-source-id: f4e3bd4f00d21321b77d4e1452400689dbca1073
-
Yedidya Feldblum authored
Summary: Add `XLOG_FIRST_N` log function. Reviewed By: simpkins Differential Revision: D26184283 fbshipit-source-id: 23081f759897bbf7949ce603f8e5edb29869b40d
-
Dan Melnic authored
Summary: Remove FOLLY_UNLIKELY from IoUringBackend::eb_event_base_loop Reviewed By: yfeldblum Differential Revision: D26272113 fbshipit-source-id: de280347908e5448cc97ffc1e1be3100cf6cd4b1
-
Yedidya Feldblum authored
Summary: Reexport `suspend_always`, `suspend_never` from `folly/experimental/coro/Coroutine.h`, which wraps inclusion of `experimental/coroutine`. Differential Revision: D26215623 fbshipit-source-id: 5dbe5dba67e0c4dcb5a54b00753937c39833d3a7
-
Yedidya Feldblum authored
Summary: Rely on C++17 syntactic copy elision in `DelayedInit` to simplify and write `try_emplace` in terms of `try_emplace_with`. Reviewed By: praihan Differential Revision: D26260351 fbshipit-source-id: 590fdfed55ee325ed8a8ae4fa68c1db0bebf1545
-
Yedidya Feldblum authored
Summary: Move the libfmt portability code into `folly/portability/` and revise it only to mutate folly's namespace. Reviewed By: Orvid Differential Revision: D26182824 fbshipit-source-id: e0b72f523dfeac7ff7799ff2104a1146032dfbf3
-
Yedidya Feldblum authored
Summary: Let folly coro headers always be buildable whether or not coroutines are available. They may just be empty apart from transitive includes. Reviewed By: iahs Differential Revision: D26191449 fbshipit-source-id: 5865ce5edb13f97624b9f60c45c045886fdf0bfb
-
- 04 Feb, 2021 3 commits
-
-
Misha Shneerson authored
Summary: Currently, when C++ threads communicate with python's event loop, they place the items on the queue, notify the event loop, and when even loops starts running, they would consume all items from this queue at once. The downside of this approach is that we are unable to deprioritize the upstream tasks to yield to internal python tasks. However, such ability to yield is fundamental to how Thrift approaches load shedding under overload. In this diff we change the approach to take only a single item from the queue at a time. Notice that if queue is not emptied, the consumer will notify the event loop to consume from this queue on the next iteration of the loop. Reviewed By: zhxchen17 Differential Revision: D26228933 fbshipit-source-id: 827d21df12b65d518109151cb150cd45e513da57
-
Yedidya Feldblum authored
Summary: Tweaks to `folly::DelayedInit`: * No potential for ambiguity in placement-new by using `::new` and casting the address to `void*`. * Helper functions `slot` and `store` simplify `try_emplace_with` and `try_emplace`. * `try_emplace_with` and `try_emplace` are no longer `const`-qualified, removing the need for `mutable` qualifiers. The emplacement members should not be `const`-qualified since they are not semantically non-modifying. The `const` qualifier signals semantic non-modification. While it is the case that there are customs around `const` qualifiers and concurrency, these customs are not the core meaning of `const`. Reviewed By: praihan Differential Revision: D25919779 fbshipit-source-id: 95e5c4b4abf5285fbb00dddda1192998baf6ee59
-
Maged Michael authored
Summary: The change aims to make it easier to catch user bugs of using the map during or after its destruction in optimized modes without ASAN. The changes are: - Clear the buckets_ and chunks_ pointers in the corresponding destructors. - Add DCHECK-s of buckets_ (or chunks_) in other member functions when non-null values are expected. Reviewed By: davidtgoldblatt Differential Revision: D26232735 fbshipit-source-id: 14f0c11e10997773efb78c7275db99932dd19703
-