Commit Graph

13 Commits

Author SHA1 Message Date
Adam Simpkins
4917682fc6 add a tag parameter to ThreadLocal<EdenStats>
Summary:
Update all of the code using ThreadLocal<EdenStats> to pass in a non-default
Tag parameter to the ThreadLocal template.

A non-default tag parameter is required to use the accessAllThreads() method on
the ThreadLocal object.  We need to use accessAllThreads() to perform stats
aggregation correctly.  Currently the EdenServer code is only performing
aggregation for stats in the FunctionScheduler.

This diff only updates the ThreadLocal<EdenStats> type, but does not contain
any behavior changes.  I will fix the stats aggregation in a subsequent diff.

Reviewed By: bolinfest

Differential Revision: D5657268

fbshipit-source-id: bc4b6f56324eb8d3052c023fd3f6f64f99b1d4e0
2017-08-18 11:50:56 -07:00
Andrew Gallagher
1275eaaa90 eden: disable autodeps on eden/fs/fuse/TARGETS
Summary:
Recently, autodeps switched to requiring simple types for the various dep
parameters in order to support proper annotation parsing (D5387184), which
started breaking on `eden/fs/fuse/TARGETS`.

Reviewed By: simpkins

Differential Revision: D5620249

fbshipit-source-id: 16fa2c73421ff7e9929c71290a662babde1289ec
2017-08-16 23:15:44 -07:00
Adam Simpkins
47ba88f62d move dropPrivileges() to UserInfo, and restore supplimentary groups
Summary:
Move the dropPrivileges() function from the PrivHelper code to the UserInfo
class, and update it to correctly set supplementary groups when dropping
privileges.

Reviewed By: bolinfest

Differential Revision: D5501254

fbshipit-source-id: 62d7a91685ae72a73e848236f6e6f636b6203481
2017-07-27 19:39:00 -07:00
Adam Simpkins
61cac1cbea add a new UserInfo class for looking up UID/GID info
Summary:
This adds a new UserInfo class to store the UID, GID, as well as the username
and home directory.  This moves the determineUid() and determineGid() functions
from main.cpp into this new class, and makes the logic somewhat smarter now.

In addition to looking up the UID and GID, we now look up the username.  This
information is not used yet, but will be used in an upcoming diff to set
supplementary groups.

This also stores the home directory in the UserInfo class.  The home directory
is usually necessary to find the user's ~/.edenrc file.  Computing it as part
of UserInfo makes the most sense since we will likely have already looked up
the user's passwd entry.

Reviewed By: bolinfest

Differential Revision: D5501252

fbshipit-source-id: 1cb4be9f6c1493de4362da3393034e78bedd9db2
2017-07-27 19:38:59 -07:00
Victor Gao
a477e9663f comment out unused parameters
Summary: This uses `clang-tidy` to comment out unused parameters (in functions, methods and lambdas) in fbcode. Cases that the tool failed to handle are fixed manually.

Reviewed By: igorsugak

Differential Revision: D5454343

fbshipit-source-id: 5dee339b4334e25e963891b519a5aa81fbf627b2
2017-07-21 15:01:05 -07:00
Adam Simpkins
40e9a83cf2 always forcibly unmount eden mounts
Summary:
Always call umount2() with the MNT_DETACH flag.  This prevents the unmount
operation from failing if the mount point is still busy.

This is pretty much always necessary in Facebook's environment, since chg
processes tend to hold open long-lived file handles inside the mount point.
In the future we could potentially add back an option to only unmount if the
mount point is not busy, but I'll wait to do that until we find a use case for
it.

Reviewed By: akushner

Differential Revision: D5367407

fbshipit-source-id: 6805fe37346b9b35af3c40ab84c0187d8deafbd0
2017-07-07 16:01:31 -07:00
Christopher Dykes
658a89174a Auto-dep the auto-dep'd TARGETS
Summary:
This is mostly needed because of the `folly:file` target split, but there are a few other that had changes that weren't reflected.

This also re-enables auto-deps for `multifeed/aggregator/processor/TARGETS` as it works again.

Reviewed By: yfeldblum

Differential Revision: D5362875

fbshipit-source-id: f9d2793249c0bfe644d0504f19839c108648ea3b
2017-07-02 15:50:51 -07:00
Christopher Dykes
0970c1e12a Merge StringBase.cpp into String.cpp
Summary: It doesn't need to exist anymore

Reviewed By: yfeldblum

Differential Revision: D5318746

fbshipit-source-id: c70b184f4b3fc12ede4632d6b3d43de16ed758c7
2017-06-29 20:20:11 -07:00
Adam Simpkins
429f737816 format eden/fs TARGETS files with autodeps
Summary:
Format all of the TARGETS files under eden/fs with the autodeps tool.

A few rocksdb include statements require comments so that autodeps can
correctly tell which dependency this include comes from.  The rocksdb library's
source file structure unfortunately does not match the layout of how its header
files get installed, so autodeps cannot figure this out automatically.

Reviewed By: wez

Differential Revision: D5316000

fbshipit-source-id: f8163adca79ee4a673440232d6467fb83e56aa10
2017-06-27 21:20:15 -07:00
Christopher Dykes
3c2bb6b1dd Cleanup the logging targets
Summary: This includes adjusting them to conform to Folly's style for single file sources and headers, making targets as small as possible, not providing aggregate targets, and using auto-deps.

Reviewed By: yfeldblum

Differential Revision: D5312078

fbshipit-source-id: 1c7f5aa04da3bad236ffa23000c7bda47b82e3ef
2017-06-23 15:58:11 -07:00
Adam Simpkins
b0d1e57975 update logging statements to use folly logging APIs
Summary:
Update eden to log via the new folly logging APIs rather than with glog.

This adds a new --logging flag that takes a logging configuration string.
By default we set the log level to INFO for all eden logs, and WARNING for
everything else.  (I suspect we may eventually want to run with some
high-priority debug logs enabled for some or all of eden, but this seems like a
reasonable default to start with.)

Reviewed By: wez

Differential Revision: D5290783

fbshipit-source-id: 14183489c48c96613e2aca0f513bfa82fd9798c7
2017-06-22 13:50:13 -07:00
Andrew Gallagher
03bdaff954 codemod: format TARGETS with buildifier [4/5] (D5092623)
Reviewed By: igorsugak

fbshipit-source-id: 277a9d2bdc1d7e3ff3075bfe2d7307502fd0a507
2017-06-01 17:52:40 -07:00
Adam Simpkins
a6ae3edab9 move eden/utils and eden/fuse into eden/fs
Summary:
This change makes it so that all of the C++ code related to the edenfs daemon
is now contained in the eden/fs subdirectory.

Reviewed By: bolinfest, wez

Differential Revision: D4889053

fbshipit-source-id: d0bd4774cc0bdb5d1d6b6f47d716ecae52391f37
2017-04-14 11:39:02 -07:00