mirror of
https://github.com/facebook/sapling.git
synced 2024-10-04 22:07:44 +03:00
Make sure shutdown() errors propagate to unmount() waiters
Summary: Use SharedPromise::setFuture to make sure errors propagate. Reviewed By: simpkins Differential Revision: D6515818 fbshipit-source-id: dee95bccdc086a040ead08e60373cbc7daa4db3f
This commit is contained in:
parent
0b74d03fbd
commit
5eaddd7921
@ -542,10 +542,10 @@ void EdenServer::mountFinished(EdenMount* edenMount) {
|
||||
|
||||
// Shutdown the EdenMount, and fulfill the unmount promise
|
||||
// when the shutdown completes
|
||||
edenMount->shutdown().then(
|
||||
[unmountPromise = std::move(unmountPromise)]() mutable {
|
||||
unmountPromise.setValue();
|
||||
});
|
||||
edenMount->shutdown().then([unmountPromise = std::move(unmountPromise)](
|
||||
folly::Try<folly::Unit>&& result) mutable {
|
||||
unmountPromise.setTry(std::move(result));
|
||||
});
|
||||
}
|
||||
|
||||
EdenServer::MountList EdenServer::getMountPoints() const {
|
||||
|
@ -203,7 +203,7 @@ class EdenServer : private TakeoverHandler {
|
||||
|
||||
private:
|
||||
// Struct to store EdenMount along with SharedPromise that is set
|
||||
// during unmount to allow synchronizaiton between unmoutFinished
|
||||
// during unmount to allow synchronization between unmountFinished
|
||||
// and unmount functions.
|
||||
struct EdenMountInfo {
|
||||
std::shared_ptr<EdenMount> edenMount;
|
||||
|
Loading…
Reference in New Issue
Block a user