Commit Graph

23 Commits

Author SHA1 Message Date
Adam Simpkins
e1490e631c add a counter to report the number of mount failures during startup
Summary:
Add a counter to report the number of mounts that we failed to remount during
startup.  Mount failures do not prevent EdenFS startup from proceeding.  It is
useful to have a metric to report if these errors did occur even though the
start-up as a whole still proceeded otherwise.

Reviewed By: chadaustin

Differential Revision: D20319512

fbshipit-source-id: fd503a1ccc91b476cc9dc2bc6323501bbbeaf2c5
2020-03-09 17:41:34 -07:00
Adam Simpkins
ef04ccf546 replace a bunch of pyre-fixme comments with pyre-ignoree
Summary:
D17135557 added a bunch of `pyre-fixme` comments to the EdenFS integration
tests for cases where Pyre cannot detect that some attributes are initialized
by the test case `setUp()` method.

It looks like Pyre's handling of `setUp()` is somewhat incorrect: it looks
like if a class has a `setUp()` method this currently suppresses all
uninitialized attribute errors (even if some attributes really are never
initialized).  However, Pyre does not detect `setUp()` methods inherited from
parent classes, and always warns about uninitialized attributes in this case
even they are initialized.

Lets change these comments from `pyre-fixme` to `pyre-ignore` since this
appears to be an issue with Pyre rather than with this code.  T62487924 is
open to track adding support for annotating custom constructor methods, which
might help here.  I've also posted in Pyre Q&A about incorrect handling of
`setUp()` in derived classes.

Reviewed By: grievejia

Differential Revision: D19963118

fbshipit-source-id: 9fd13fc8665367e0780f871a5a0d9a8fe50cc687
2020-02-24 18:55:19 -08:00
Wez Furlong
c03af477eb eden: remove legacy bind mount concept from redirections
Summary:
Now that we've transitioned to the newer redirections
configuration we can remove the older bind mounts configuration
parsing, and that is what this diff does.

This is helpful because in situations where the user has run
`hg co null` as part of some troubleshooting advice, the legacy
bind mounts would remain mounted and obstruct some of the
steps that would have fixed up the users repo.

Reviewed By: pkaush

Differential Revision: D18337246

fbshipit-source-id: 23f27787d609e1c38a9c98b8b6596bb40743b9ca
2019-12-04 10:47:14 -08:00
Genevieve Helsel
894416f20a add EdenErrorType to EdenError
Summary: Adds a non-optional EdenErrorType struct for EdenError, this can be used in case of special error case handling of errors without error message parsing. Currently this is just passed along and not consumed anywhere in the client, but later in the stack is used for specific retry of checkout if "CHECKOUT_IN_PROGRESS" on the consuming side.

Reviewed By: chadaustin

Differential Revision: D18139917

fbshipit-source-id: b3f2ec4c480fc5246ff2f46d09c436021bad8b61
2019-10-29 09:23:03 -07:00
generatedunixname89002005307016
4c76d686a8 Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: grievejia

Differential Revision: D17956249

fbshipit-source-id: d5c8b5aa73151b3fea67aec35d70f332030da2c9
2019-10-16 16:56:29 -07:00
Andres Suarez
fbdb46f5cb Tidy up license headers
Reviewed By: chadaustin

Differential Revision: D17872966

fbshipit-source-id: cd60a364a2146f0dadbeca693b1d4a5d7c97ff63
2019-10-11 05:28:23 -07:00
Wez Furlong
d58a3c96d8 eden: remove legacy bind mount code
Summary:
This diff removes the logic that consumes the legacy bind
mount list and mounts them on startup.  That functionality has been
replaced with the eden redirect command.

Instead of performing the bind mounts in the server, the server will
now run `eden redirect fixup` to apply that configuration.

This diff also changes the behavior of performBindMounts: previously, if the
bind mount setup failed, we would tear down the entire repo mount.  Since we're
now spawning an external process, it is much more likely that something might
fail and result in a bad experience, so we no longer bail out in that case:
we'll continue and leave the bind mounts as-is.  The user can then use `eden
doctor` or `eden redirect fixup` to sort things out.

Reviewed By: simpkins

Differential Revision: D17236366

fbshipit-source-id: 8b004551a076216f0e5448942f00b5195ee18803
2019-09-30 18:57:14 -07:00
generatedunixname89002005289445
13e683608d Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: sinancepel

Differential Revision: D17135557

fbshipit-source-id: 07afef940271a277c75834892733901d070bfa5f
2019-08-30 13:37:34 -07:00
generatedunixname89002005289445
01d06886cb Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: sinancepel

Differential Revision: D16863919

fbshipit-source-id: c76f41992b9a1a57080eed932724b65c1fd846f5
2019-08-16 14:44:25 -07:00
Chad Austin
fe64ec3874 use fb303 repo in open source build
Summary: Add a dependency from the eden open source build to the fb303 open source build and switch EdenServiceHandler to BaseService.

Reviewed By: simpkins

Differential Revision: D15528156

fbshipit-source-id: 2ca5c31dd9fcc9bac43fd399b27f33b6f2c5ebfc
2019-07-24 21:07:04 -07:00
Adam Simpkins
9bfb48c921 update license headers in .py files
Summary:
Update the copyright & license headers in Python files to reflect the
relicensing to GPLv2

Reviewed By: wez

Differential Revision: D15487088

fbshipit-source-id: 9f2138dff41048d2c35f15e09a04ae5a9c9c80dd
2019-06-19 17:02:46 -07:00
Adam Simpkins
20f211acb8 remove unused python imports
Summary: Remove a number of unused imports detected by the linter.

Reviewed By: wez

Differential Revision: D15776268

fbshipit-source-id: 221f45d275664d037bbabcac9858b40266b4833e
2019-06-12 14:00:57 -07:00
Adam Simpkins
79f873f81c automatically create mount directories when necessary
Summary:
This updates `edenfs` to automatically create the mount point directory
if it does not exist.

Previously the `eden mount` CLI command would automatically create the mount
directory in the Python logic.  This adds similar logic to the C++ code, which
handles more situations.  In particular this makes it so that `eden start`
will now automatically create missing mount point directories.

Note that the C++ code does not create the `README_EDEN.txt` symlink inside
the mount point if it is missing.  We could move that functionality into the
C++ code in the future if needed.

Reviewed By: strager

Differential Revision: D14254699

fbshipit-source-id: bad5634f57fba6e7af3b6a3830eb51ac099b435e
2019-03-07 12:36:04 -08:00
Adam Simpkins
4dc59b856b ensure that most thrift calls cannot access initializing mounts
Summary:
This updates the `EdenServer` class so that the existing `getMount()` and
`getMountPoints()` APIs only return mounts that have finished initializing.

These APIs are primarily used by the thrift interfaces.  In most cases the
callers did not intend to operate on mounts that were still initializing, and
doing so was unsafe.  The code could potentially dereference a null pointer if
it tried to access the mount's root inode before the root inode object had
been created.

New `getMountUnsafe()` and `getAllMountPoints()` APIs have been added for call
sites that explicitly want to be able to access mounts that may still be
initializing.  Currently the `listMounts()` thrift API is the only location
that needs this.

Reviewed By: strager

Differential Revision: D13981139

fbshipit-source-id: e6168d7a15694c79ca2bcc129dda46f82382e8e9
2019-03-06 20:33:42 -08:00
Adam Simpkins
b47184adc4 add a flag to report start-up success before finishing mounts
Summary:
Add a flag to tell edenfs to report successful start-up as soon as the thrift
server is running, without waiting for all mount points to finish being
remounted.

In the future I plan to have edenfs automatically perform an fsck scan of the
overlay for checkouts that were not shut down cleanly.  This may cause the
remount to take a significant amount of extra start-up time in some cases.
(This is already true today in some cases even with the simpler scan we do to
re-compute the max inode number.)

I think we will probably want to have systemd invoke edenfs with this option,
so that we do not time out during system start up if some mount points need to
be rescanned.

Reviewed By: strager

Differential Revision: D13522040

fbshipit-source-id: 6f183770c25efee34c4805c9bad42a9cce51039e
2019-03-06 20:33:41 -08:00
Adam Simpkins
5abf0a6aed automatically recreate bind mount source directories when necessary
Summary:
Update `edenfs` to automatically create the bind mount source directories if
they are missing.  Previously Eden would report an error and would not be able
to mount the checkout if some of the bind mount source directories were
missing.

Reviewed By: strager

Differential Revision: D14253771

fbshipit-source-id: 87ad091ccf2c0f0f72aebb50437fd7680ddbfd1c
2019-03-04 19:57:01 -08:00
Adam Simpkins
61856d0919 enable blocking mount initialization via fault injection
Summary:
Update `EdenMount::initialize()` to perform a fault injection check.  This
allows test code to inject delays and errors into the mount initialization
flow.

Reviewed By: strager

Differential Revision: D14079491

fbshipit-source-id: be80135b0833c8f0300104524473cc3e949fec34
2019-02-26 18:43:22 -08:00
Adam Simpkins
ec0f87fa4d update eden list to report the mount state information
Summary:
Update the `eden list` command to also report the current state for each
checkout if it is not running normally.  Also added a `--json` flag to
print information as JSON so it can be consumed programmatically.

Reviewed By: strager

Differential Revision: D13503053

fbshipit-source-id: 4ef366f5bf4a1157036fdfd7ff1056079588e802
2019-01-25 16:38:28 -08:00
Adam Simpkins
9e21449bee move creation of the .hg directory into the Eden CLI
Summary:
Update the `eden clone` command to automatically create the `.hg` directory
when creating a checkout for a Mercurial repository.

Previously this logic was performed by a separate post-clone hook that was
invoked by `eden clone`.  Having this logic in a separate script made the code
slightly more complicated, and meant that configuring Eden was also more
complicated, as the hook also needed to be installed and configured.  Moving
the logic into the Eden CLI will make it easier to re-use this code in
`eden doctor` if the `.hg` directory needs to be repaired.

Reviewed By: wez

Differential Revision: D13447272

fbshipit-source-id: 11c4f8e389aead151dd235eff95c860a326967af
2018-12-19 15:34:01 -08:00
Chad Austin
cc1ede2ffa stop counting open FileInode handles
Summary:
Now that FileInode read and write operations are stateless via BlobAccess and OverlayFileAccess,
EdenFileHandle no longer provides any value. Remove it. This also fixes eden's shutdown timeout
when a file handle is open and paves the way for FUSE_NO_OPEN_SUPPORT.

Reviewed By: strager

Differential Revision: D13325137

fbshipit-source-id: 71ed47a7c997f5035b4394ccb311f94332ecd8c2
2018-12-12 17:10:29 -08:00
Chad Austin
9dbdccb8ed remove TreeInodeDirHandle, fix unmount while dir handle is open
Summary:
Stop holding a reference count to the TreeInode while a directory
handle is open. This allows eden to shut down while a directory handle
is open.

Reviewed By: strager

Differential Revision: D13287701

fbshipit-source-id: a24f32a1ac40b6c19bc5864aa5f5785f3016361b
2018-12-04 16:37:41 -08:00
Chad Austin
bfbf3bfe37 tests that unmounting succeeds when file handles are open
Summary:
Add some skipped tests that illustrate that Eden cannot shut down when
file handles are open. They will be enabled later in this stack as the
root cause is fixed..

Reviewed By: strager

Differential Revision: D13287587

fbshipit-source-id: cd8d79896127676853c183bb4b86c0d586ce511e
2018-12-03 17:43:34 -08:00
Chad Austin
1e007b63cc move mount tests into their own file
Summary: I'm about to add some more integration tests for unmounting.

Reviewed By: strager

Differential Revision: D13279068

fbshipit-source-id: e84580497f22b9dc6d5a04835dc4beede52a07fd
2018-12-03 17:43:34 -08:00