Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves UserInfo from eden to edencommon.
Reviewed By: kmancini
Differential Revision: D56326986
fbshipit-source-id: 80ff63a33b3f692be8c9a94d38c41409bc1b49f5
Summary: The fix is being worked on, but to reduce confusion, its probably worth just changing our TARGETS files since its a no-op change
Reviewed By: jdelliot
Differential Revision: D56495193
fbshipit-source-id: 10370b333cfd8ef316f9f257009ba4200869e21e
Summary: Under c++17, `folly::in_place` is just an alias for `std::in_place`. Migrate existing uses.
Reviewed By: Gownta
Differential Revision: D55085146
fbshipit-source-id: bf3b08da10de0e4c7f698513d545fb6159cea131
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves SysctlUtil from eden to edencommon.
Reviewed By: genevievehelsel
Differential Revision: D54471684
fbshipit-source-id: df6d0716dfe371d8c7fc1fe80079649b85b50e6b
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves RefPtr from eden to edencommon.
Reviewed By: genevievehelsel
Differential Revision: D54471553
fbshipit-source-id: 407978616391b72649f72ca1f626df6700814dc3
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves EnumValue from eden to edencommon.
Reviewed By: genevievehelsel
Differential Revision: D54471130
fbshipit-source-id: 9f0828f4864f43fa4b400d0738333d07c09b93c4
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves SpawnedProcess from eden to edencommon.
Reviewed By: genevievehelsel
Differential Revision: D54471128
fbshipit-source-id: 5c8caa7d6388ba9a3753cb483ba8d11adc5eb87c
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves utils:io from eden to edencommon.
Reviewed By: genevievehelsel
Differential Revision: D54443719
fbshipit-source-id: 1c88d60126cab0d878c295b1d3ffbf9d8e6f1718
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves utils:utils from eden to edencommon.
NOTE: This is a large diff, so breaking the tests into separate subsequent diff.
Reviewed By: genevievehelsel
Differential Revision: D54442946
fbshipit-source-id: 99ef0e0cf60693bc809929f6735cf4bc2a1d84ba
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves utils:utils from eden to edencommon.
NOTE: This is a large diff, so breaking the tests into separate subsequent diff.
Reviewed By: genevievehelsel
Differential Revision: D54442939
fbshipit-source-id: 1cfbfa10d2dc4bbf7379d700978198b8b6788c71
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves FileUtils and PathFuncs from eden to edencommon.
NOTE: FileUtils and PathFuncs are mutally dependent so they were migrated togehter. Most of the files touched, however, was due to PathFuncs.
Reviewed By: genevievehelsel
Differential Revision: D54393041
fbshipit-source-id: 6dc404b1b1066704584da512220475e9ee486247
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves Try from eden to edencommon.
Reviewed By: genevievehelsel
Differential Revision: D54379294
fbshipit-source-id: 9fdc8c896a6a09f959a25d0bee82a623650ced32
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves Match from eden to edencommon.
Reviewed By: genevievehelsel
Differential Revision: D54378643
fbshipit-source-id: f291126d2455cc2fdddffa4914be0c9d3f44f634
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves TempFile from eden to edencommon.
Reviewed By: genevievehelsel
Differential Revision: D54372850
fbshipit-source-id: 681f00c2b8b2c353b802c680fe62382d86ee7c8d
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves SystemError from eden to edencommon.
Reviewed By: MichaelCuevas
Differential Revision: D54343729
fbshipit-source-id: 7861e3effc9d242fbeda34333078c14c4d021a80
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves Utf8 from eden to edencommon.
Reviewed By: fanzeyi
Differential Revision: D54341648
fbshipit-source-id: b1461a7f92963100914733d69de6eb574af3e1f9
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves String from eden to edencommon.
Reviewed By: fanzeyi
Differential Revision: D54341192
fbshipit-source-id: 8f0763313e5585efeb336038f41c646d84986ec3
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves Memory from eden to edencommon.
Reviewed By: fanzeyi
Differential Revision: D54340336
fbshipit-source-id: cd209be7f39452123ffc41312cf370a48e4923bc
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves CaseSensitvity from eden to edencommon.
Reviewed By: fanzeyi
Differential Revision: D54339283
fbshipit-source-id: f96a421f4390578e5d2281b307532c62e22935d3
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves ImmediateFuture from eden to edencommon.
Reviewed By: fanzeyi
Differential Revision: D54337631
fbshipit-source-id: 2e09a9e244ef8b8b662959c1b14db3e103f559d0
Summary:
`nullptr` is typesafe. `0` and `NULL` are not. In the future, only `nullptr` will be allowed.
This diff helps us embrace the future _now_ in service of enabling `-Wzero-as-null-pointer-constant`.
Reviewed By: meyering
Differential Revision: D54163067
fbshipit-source-id: 3473ba42193c8dd3cd61b8f170d20c7279f88521
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.
This change moves Throw.h and it's related tests from eden to edencommon.
Reviewed By: genevievehelsel
Differential Revision: D54046153
fbshipit-source-id: 669d702c13e70536d9c0b58ff8ff17f826237851
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.
This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.
**What's a shadowed variable?**
Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.
This diff fixes such an issue by renaming the variable.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: palmje
Differential Revision: D53478924
fbshipit-source-id: 619cd5814bdc1804edb6366e381f26bfe75bb56d
Summary:
X-link: https://github.com/facebookincubator/velox/pull/8558
The attribute `[[fallthrough]]` is standard C++17. We no longer need to wrap it.
Reviewed By: Orvid
Differential Revision: D53034074
fbshipit-source-id: 19b1e8314e70f3e08882e76b93f7ded4df7ab9f2
Summary: We can now share parsing logic in the CheckoutConfig layer when we're parsing the last RootID from the SNAPSHOT file.
Reviewed By: kmancini
Differential Revision: D52185706
fbshipit-source-id: f9aa8a9d4b7d349917b80da38b6eb5ec368ba227
Summary:
Most of it was replaced with a ManualExecutor. Some care had to be taken around
the use of StoredObject as triggering an error on them when no future was
obtained from it leads to the error not being triggered when the future is then
retrieved from it.
The only place where QueuedImmediateExecutor is still present is in the
ImmediateFutureTest to demonstrate the lack of safety with it.
Reviewed By: genevievehelsel
Differential Revision: D51302393
fbshipit-source-id: fb66a9426e0ae7672799bd997898e8b525ff112c
Summary:
The return value of the passed in lambda is dropped in the `ensure` method,
thus the future returned by `completeInvalidations` would never be waited on,
potentially leading to weird bugs.
This is only used in a debug CLI command so this shouldn't have any effect, but
let's add a static_assert check in the ImmediateFuture code to make sure it
isn't misused elsewhere or in the future.
Reviewed By: genevievehelsel
Differential Revision: D51254287
fbshipit-source-id: 9fcfabbf2318aef739ca44daf1543dc0b83f82e3
Summary: Adds a function to collate two different path maps by entry name.
Reviewed By: genevievehelsel
Differential Revision: D50989168
fbshipit-source-id: dc6d94970cbb45230e334269d415b8ea226a3878
Summary:
Eden builds allow for shadow declarations to hide members, parameters, etc.
This can lead to subtle bugs and frustrations. Lets fix that. This first update enables shadow warngings for most problematic types of shadows. With errors on by default, this will block local and CI builds.
Reviewed By: xavierd
Differential Revision: D50434604
fbshipit-source-id: 976bd2e86c620f1f0e62e19867c81840fee645c9
Summary: Before all the EdenFS symlink changes on Windows, replacing a "fake" symlink with an actual symlink would make that file show up as modified. This diff reverts that behavior.
Reviewed By: kmancini
Differential Revision: D49755711
fbshipit-source-id: 03ea79e9af59264a2c1303240494a862d140f86f
The internal and external repositories are out of sync. This Pull Request attempts to brings them back in sync by patching the GitHub repository. Please carefully review this patch. You must disable ShipIt for your project in order to merge this pull request. DO NOT IMPORT this pull request. Instead, merge it directly on GitHub using the MERGE BUTTON. Re-enable ShipIt after merging.
Summary:
See why on previous diff
Now with this diff GlobTree is independent of inode
Reviewed By: kmancini
Differential Revision: D49933175
fbshipit-source-id: 1551a2b7e054df5df88ac37fbf0bf45f91e34548
Summary:
This adds a synchronous FaultInjector::check method so we can handle errors in
synchronous code without throwing and catching.
In the process, I rework the checkImpl functions:
- Now the check logic is deduplicated into checkAsync
- checkTry just blocks on checkAsync on a single thread
- check just unwraps any exception from checkTry
Reviewed By: chadaustin
Differential Revision: D49108908
fbshipit-source-id: 1c2a614d0dde5cae0c341f55f90128f710b5ef6d
Summary:
We have multiple FaultInjector::check* templates with different parameters,
which will lead to an unweildy number of implementations when we add one that
returns a Try. This cleans things up by overloading constructKey to forward
std::string_view directly to the implementations, so we can then remove the
versions that accept keyValue as a string_view.
Reviewed By: chadaustin
Differential Revision: D49114096
fbshipit-source-id: 1b25ea365537e285c65053468a48e837b983d5ab
Summary:
When doing a hack-a-month task I punted on cleaning up some new code to retrieve a simple, human-readable process name - https://www.internalfb.com/diff/D47276991?dst_version_fbid=795860982081651&transaction_fbid=584703497175444.
This change moves the fetching of a simple process name into the process name cache. My first cut at this kept ProcessName and ProcessSimpleName entirely separated in the cache, but the async processing fetched the two together. This felt pretty klunky, so this cut now bundles up ProcessName and ProcessSimpleName along with the pid and ppid (parent pid) into a new struct, ProcessInfo and changes to cache that instead.
In some areas this is more ergonomic and otthers it slightly less ergonomic. The fact we obtain both names and parent pid is overkill in some cases, but what is needed for others. Given that these are used for logging and diagnostics this seemed OK to me.
Note: ProcessSimpleName is only implemented (validly) for macOS today. Adding other platofms should not be difficult, but there is no use case at this time.
Reviewed By: kmancini
Differential Revision: D48923253
fbshipit-source-id: abcbc604e7a319bf1c249cf94948e4ff4b2504c9
Summary: In preparation for merging ProcessSimpleName and ProcessName functionality into ProcessNameCache moving some helper functions to ProcessInfo.
Reviewed By: genevievehelsel
Differential Revision: D48923254
fbshipit-source-id: 9223d45c3b36924750292a302f091fac924ed4cf
Summary: In preparation for merging ProcessSimpleName and ProcessName functionality into ProcessNameCache renaming now The new cache will cache ProcessInfo object which will include both names, and the parent pid.
Reviewed By: genevievehelsel
Differential Revision: D48855222
fbshipit-source-id: 4cb10df7b6cc32efc0d655771d01d58e7ba57dd5
Summary:
CentOS Stream 9 comes with a much newer version of gcc (11.4.1) than either earlier devservers (8.5) and sandcastle (8.4).
This set of changes enables builds to succeed on newer devservers. One set of errors was realted to ImmediateFuture where `makeNotReadyImmediateFuture` failed with an "class template argument deduction failed" error. Looking at the errors it looked like using parens instead of curly braces might be the solution. However, this did not change the outcome. Another error in the output was that the `SemiFutureReadiness` enum was private. Moving this to public fixed this error.
Next up was an issue where size_t was undefined in RingBuffer.h. Easy add of <stddef.h> resolved this issue.
Reviewed By: xavierd
Differential Revision: D48250671
fbshipit-source-id: 646e0d5865593a16ba29131c2443b87f2bb4820e
Summary:
When the NFS crawl detection logic runs, it walks over the list of processes that have open files in any of the Eden mounts. If a given process hierarcy has mulitple non-exluded process with open files they are reported multiple times. This change keeps track of which pids have been seen in the reporting and only reports them one time. It also detects process hierarchies that are proper subsets of and only retains the longest hiearchy for reporting.
NFS crawl detection is still pretty basic - simple detecting that certain metrics have crossed a threshold and reporting which processes have open files in Eden mounts. Future improvements could use this trigger to initiate sampling of open files over a short interval to better refine which processes are actually opening multiple files and not just holding a static list. This improvement could be made in the future if this simple mechansim is too noisy.
Reviewed By: mshroyer
Differential Revision: D48095393
fbshipit-source-id: c85f5dd7d8a7d184cd41d4b0604795874e123641
Summary:
This allows hg on EdenFS to be able to create symlinks with absolute paths on Windows as well as check out commits with absolute path symlinks.
There are a few caveats here:
- Symlinks with absolute paths will only be usable on the same type of OS (Windows vs. POSIX) they were created.
- Checking out commits with absolute paths created on POSIX (i.e., starting with `/`) aren't usable on Windows
- Symlinks with absolute paths created on Windows will keep the same drive letter across different checkouts.
- E.g., if the root of the EdenFS checkout is somewhere at `C:\` and there is a symlink pointing to somewhere like `D:\foo\bar.txt`, and then that same commit is checked out in a different Windows machine with that same repo mounted at `E:\`, that symlink will still point to `D:\foo\bar.txt`
If there seems to be some UNC wonkiness in this commit, it is because UNC usage on symlinks is quite inconsistent on Windows:
- Things that use UNC for absolute path symlinks:
- Windows' `mklink` command (creates symlinks with UNC paths)
- Python's `os.symlink` (same as above)
- Hg commits
- EdenFS (when stored as Inodes; some functions like `realpath`)
- Things that don't use UNC for absolute path symlinks:
- `PrjWritePlaceholderInfo2`
- `PrjFillDirEntryBuffer2`
- `std::filesystem::read_symlink`
Reviewed By: xavierd
Differential Revision: D47227590
fbshipit-source-id: b92c8462ad3f13c2724b76ee61f8c095695027cd
Summary: This appears to be unused, no need to keep it around.
Reviewed By: kmancini
Differential Revision: D47959163
fbshipit-source-id: a07d2d7e09d376ee81cb9db33eb7710e90daf5da