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:
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: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 SystemError from eden to edencommon.
Reviewed By: MichaelCuevas
Differential Revision: D54343729
fbshipit-source-id: 7861e3effc9d242fbeda34333078c14c4d021a80
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: We're seeing even more users that are crashing due to win32 errors. It seems like these sorts of E-Menu issues shouldn't crash Eden entirely. A non-functional E-Menu is better than crashing Eden entirely. Therefore, let's log these as errors for now.
Reviewed By: xavierd
Differential Revision: D45365471
fbshipit-source-id: f4092a9d44c1c5e6749e52d7e656c5de339551d3
Summary:
We've seen at least 1 user that crashed due to:
```
E0417 09:41:18.412118 20840 WindowsNotifier.cpp:68] TrackPopupMenuEx failed: Error (0x5a6) Popup menu already active.
F0417 09:41:18.434692 20840 WindowsNotifier.cpp:454] Exception occurred in E-Menu WndProc: TrackPopupMenuEx failed: Error (0x5a6) Popup menu already active.
```
Failures like this really shouldn't cause the entirety of Eden to crash, so let's ignore it for now.
Reviewed By: chadaustin
Differential Revision: D45130458
fbshipit-source-id: f906a17ac359f2a3c48a852d0668f70014ccd63d
Summary:
The EdenFS telemetry shows that 90% the vast majority of all the EdenFS crashes
on Windows occur very shortly after starting up, with most of these pointing to
~thread failing. This is triggered by a non-detached thread not being joined.
Looking at backtraces containing symbols and sources, the crash appears to
occur due to the windowsEventLoop throwing an exception but never being joined,
due to the ~WindowsNotifier never being called.
To fix this, we can simply split the WindowsNotifier constructor in 2: the
construtor, and an initialize method that may throw. This ensures the
destructor is always called.
Reviewed By: MichaelCuevas
Differential Revision: D42272618
fbshipit-source-id: bf092573b3e4de2210a2b9c6124bf93c718cb3ae
Summary: Adds a per active mount inode population count status report to the E-Menu.
Reviewed By: MichaelCuevas
Differential Revision: D38997531
fbshipit-source-id: 1646b22cd55a32db8d8baec09acc1f201f641349
Summary:
Fixes https://github.com/facebookexperimental/edencommon/issues/3
`utils` is a bit too generic and Gentoo seems to be building edencommon into a shared library.
Reviewed By: chadaustin
Differential Revision: D38719753
fbshipit-source-id: fb46b6a7c9d3bcc3034765cb47e997a80c646b3d
Summary: Many users are unaware that EdenFS logs exist. Even if they're aware they exist, they probably don't know the log location. We should give users easy access to the logs through the E-Menu.
Reviewed By: fanzeyi
Differential Revision: D36989417
fbshipit-source-id: b3db965f4dbcf2e50640949a69a5eff2958ae8f2
Summary:
Cmake automatically includes its own manifest in executables. We should make CMake aware of our custom manifest so that it combines them together to avoid a "duplicate manifest" error
In addition, we should only include the manifest in the resource file if we're building with buck. The Cmake build will break if we try to include the manifest in the resource file. This is because every target that includes notifications will pull in the resource file, and this causes all of those targets to have duplicated manifest errors during linking.
Reviewed By: chadaustin
Differential Revision: D36318044
fbshipit-source-id: dde35e5602f0161c4961103970b880f98e399098
Summary: Users commonly run into disk usage issues. We should make this command more discoverable by adding it to the E-Menu
Reviewed By: chadaustin
Differential Revision: D36294731
fbshipit-source-id: bbd2f2bd66540188160ca3486da8142913bcc785
Summary: A majority of the strings used by the E-Menu were only used once. It doesn't make sense to have them all defined at the top of the cpp file. Instead, we should only define the ones that are used multiple times.
Reviewed By: chadaustin
Differential Revision: D36294347
fbshipit-source-id: e00c55ced14550dbd8a0ec8a58a8643c3ec24af9
Summary:
Windows allows nesting of sub-menus:
> A submenu typically contains command items, but it can also contain items that open nested submenus. By adding such items to submenus, you can nest menus to any depth.
We should probably limit the nesting level to a max of 3-4.
For now, let's nest some of the debug menu entries so that the debug menu doesn't grow too large too quickly.
Reviewed By: chadaustin
Differential Revision: D36262251
fbshipit-source-id: 8d3f103ad6ef3e0f068286c2b416d5cccac2d81d
Summary:
Add `eden rage`, `eden doctor` and `eden list` to the E-Menu under the actions sub-menu.
These commands are now more easily discovered by users.
Reviewed By: chadaustin
Differential Revision: D36262679
fbshipit-source-id: 56aa0ba67df71966a831c516141edf415520681e
Summary: Before, the E-Menu would always pop-up in the bottom right corner of the display. Now, it should pop-up wherever the cursor is positioned.
Reviewed By: chadaustin
Differential Revision: D36262555
fbshipit-source-id: c17f1e57559f552873f4c2ba2b6506974fd215b2
Summary:
When an `edenfsctl` command is invoked from the E-Menu, a PowerShell Window is opened and is immediately closed once the command finishes. This makes it hard/impossible for the user to see the command's output.
The desired behavior here is to keep the Window open long enough for the user to acknowledge the output. I did this by adding a `--press-to-continue` flag to all `edenfsctl` commands. This will mainly be used by the E-Menu, but may have uses elsewhere.
Reviewed By: chadaustin
Differential Revision: D36137709
fbshipit-source-id: a46bebb5bb5820949cd4b70579a29406afb34048
Summary:
change the tooltip during a checkout operation. Also change it back when the checkout finishes.
The debug menu can also enable this tooltip by changing the icon color to orange. Changing the color to green or white will change the tooltip back
A similar tooltip is also implemented for when EdenFS detects an unhealthy mount
Reviewed By: kmancini
Differential Revision: D35488235
fbshipit-source-id: a33ebfd15cbfd0d46eea85f32be4ddd1bb09f357
Summary:
On Windows, EdenFS should signal that it's working on a checkout operation by changing the color of the E-Menu.
We also add a debug menu option for changing the E-Menu color
Reviewed By: chadaustin
Differential Revision: D35487175
fbshipit-source-id: fae587a223e9ce910e5558b36008a8c97b9dd3ea
Summary: before, if we exceeded 24 hours of uptime the E-Menu would roll over to 0 hours of uptime. We can avoid this by adding days to the uptime print out. We don't print out the number of days if the uptime is less than 1 day.
Reviewed By: chadaustin
Differential Revision: D35954540
fbshipit-source-id: 9285433a827f8494b840e9d551cb6504f94417b7
Summary: Keep usage of Eden vs EdenFS consistent. Also update the title of the message box so it's consistent with the menu item
Reviewed By: chadaustin
Differential Revision: D35951678
fbshipit-source-id: fb62f6edf66ba9159a50130de9ed3a13fff7a1e2
Summary: "Quit E-Menu" is ambiguous and could mean a number of things. We should make it clear that clicking this menu option will cause the E-Menu notification icon to be hidden
Reviewed By: chadaustin
Differential Revision: D35950442
fbshipit-source-id: 86527479dae544bc7db3e596e3bf8477bd147213
Summary: We can potentially race if we try to update notificationStatus_ from outside the event thread. As long as we only try to update from within the single thread, we should be fine.
Reviewed By: kmancini
Differential Revision: D35514682
fbshipit-source-id: 0ee8baec6816cebf91fe4fe1c95f1156b5064a42
Summary: This menu item will cause a shell to be launched and `eden rage --report` to be run.
Reviewed By: chadaustin
Differential Revision: D35327029
fbshipit-source-id: b17c90386e8beb028848fa3d99927dae3c971add
Summary: reuse the string from earlier in the function
Reviewed By: kmancini
Differential Revision: D35334023
fbshipit-source-id: 61fc2989d5ca56eaa9c703a1725106ebb60f295f
Summary: Add the ability to enable/disable notifications from the E-Menu
Reviewed By: chadaustin
Differential Revision: D35269912
fbshipit-source-id: d51e224ea4fbf7c4c700573f7f672641a3961883
Summary: the logic used before was wrong. Fix it so that we handle all cases correctly (before we ignored the config option to turn off notifications but handled notification frequency correctly)
Reviewed By: chadaustin
Differential Revision: D35270735
fbshipit-source-id: d0be2e202fb37062e2ed73c909b9bf0e8251b343
Summary: adds a general purpose notification method (send a notification with any title/body combo)
Reviewed By: chadaustin
Differential Revision: D34453071
fbshipit-source-id: 886fcca310c82ca50340570ecebf7182e9a72f7d
Summary:
An old development GUID was used. This caused some users to be unable to start Eden with the E-Menu enabled because the GUID was associated with another executable file path. See here: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa
"The binary file that contains the icon was moved. The path of the binary file is included in the registration of the icon's GUID and cannot be changed. Settings associated with the icon are preserved through an upgrade only if the file path and GUID are unchanged. If the path must be changed, the application should remove any GUID information that was added when the existing icon was registered. Once that information is removed, you can move the binary file to a new location and reregister it with a new GUID. Any settings associated with the original GUID registration will be lost.
This also occurs in the case of a side-by-side installation. When dealing with a side-by-side installation, new versions of the application should update the GUID of the binary file."
Reviewed By: chadaustin
Differential Revision: D35302987
fbshipit-source-id: 8c898a93047ae30b97853ca31400dd1c927a39f4
Summary:
Shell_NotifyIcon(NIM_ADD) fails if there's a stale icon in the notification tray. This caused Eden to crash upon startup.
Instead of blindly adding each time, We should first call Shell_NotifyIcon(NIM_DELETE) to ensure any stale icons are removed.
We should also avoid crashing EdenFS if NIM_ADD fails.
Reviewed By: chadaustin
Differential Revision: D35302853
fbshipit-source-id: cf3f3062f96eada83fcde54616b2407e13779b0c
Summary: The Cmake build didn't properly link the E-Menu resource file. That caused EdenFS to crash on startup if users had the E-Menu enabled.
Reviewed By: chadaustin
Differential Revision: D35288550
fbshipit-source-id: 27f2f29a53ab2717fd9fd874a2cd89b81ccbb9b7
Summary:
Stack context:
To get a build setup for edencommon I picked an eden library to move over
to edencommon.
I picked process name cache. I would like to have this library in watchman
so that I can log spawning process command lines as well as client command
lines.
This diff:
process name cache depends on StringConv.h so I am moving that over.
Reviewed By: chadaustin
Differential Revision: D34218023
fbshipit-source-id: d928768a6b5f737a1c546c6f3c73acc5535fc44c
Summary:
This adds an "About Eden" section to the E-Menu which lists the current running EdenFS version and uptime.
We approximate the uptime by passing chrono::now to the Windows Notifier when we create it (it should be very-very-very close since we create the Notifier when we start the Daemon. Therefore, the uptime of the two should be equal).
Reviewed By: chadaustin
Differential Revision: D34968215
fbshipit-source-id: 726d1229b880e2ae10c2950ac4a50f36badfe9db
Summary: This diff allows users to enable a debug menu inside the eden menu.
Reviewed By: chadaustin
Differential Revision: D34585649
fbshipit-source-id: 01d24000ddb0141757fef45c2b7fc8ac7b438fe3
Summary:
Refactor the existing notification class so it uses the new Notifier interface. The notifier interface will be used to set up notifications/notification trays on different platforms.
The notifier interface is not fully completed yet. More methods will be added in a future diff.
As of now, we only have 1 Notifier, the command notifier. I hope to remove this notifier once we implement notifiers for all platforms that we support.
Reviewed By: chadaustin
Differential Revision: D34291809
fbshipit-source-id: a2a67af2683f1f88781428e8d88191f49e100e96
Summary:
With Facebook having been renamed Meta Platforms, we need to change the license
headers.
Reviewed By: fanzeyi
Differential Revision: D33407812
fbshipit-source-id: b11bfbbf13a48873f0cea75f212cc7b07a68fb2e
Summary:
On Windows, /bin/sh doesn't exist. To spawn a command in a shell, we need to
use Powershell.
Reviewed By: genevievehelsel
Differential Revision: D24864355
fbshipit-source-id: 3bcf630a90e644a31ff9db8fea9891476cad641d
Summary:
While it's unlikely to work properly (it uses /bin/sh), it compiles properly on
Windows, so let's include it in the build.
Reviewed By: wez
Differential Revision: D23520368
fbshipit-source-id: 267ba04f98f5dacc81e1772f86f5ad43c846815d
Summary:
This commit introduces a new process spawning class derived
from the ChildProcess class in the watchman codebase.
`SpawnedProcess` is similar to folly::Subprocess but is designed around the
idea that we will use a system provided spawning API to start a process, rather
than assuming the use of `fork`.
`fork` is to be avoided because it can be expensive for processes with large
address spaces and also because it interacts poorly with threads on macOS. In
particular, we see the objC runtime terminating our process in some scenarios
where fork and threads are mixed.
There are some important differences from `folly::Subprocess` and that means
that some assumptions and uses need to be altered slightly from their prior
workings. For example, detaching a SpawnedProcess moves the responsibility of
waiting on the child to a periodic task as there is no way to detach via
posix_spawn without also using fork.
On the plus side, this commit allows unifying spawning between posix and
windows systems, which simplifies the code!
Reviewed By: xavierd
Differential Revision: D23287763
fbshipit-source-id: b662af1d7eaaa9ed445c42f6c5765ae9af975eea
Summary:
This commit causes a desktop notification to be shown if we generate
EIO or ETIMEDOUT responses via fuse; the prompt is intended to make it obvious
to the user that they need to connect to the VPN.
The commit by itself doesn't show a notification, it allows configuring a
command that can be run to do something to show a notification.
The test plan includes one such configuration for our corp environment.
* It doesn't trigger for thrift-originated downloads (eg: prefetch), only for
VFS operations through FUSE.
* Ideally we'd know exactly when we have a network related error in the store
code and use that to trigger the notification. However, we have a rather
convoluted set of importers and fallbacks today, one of which is interpreting
a generic response returned from a pipe, so it is not especially clear
exactly where we should locate the logic
Reviewed By: chadaustin
Differential Revision: D17513364
fbshipit-source-id: 45134f3672679cb5580cb0c1bc12a0d6e38525ca