Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions pkg/filesystem/virtual/configuration/fuse_mount_enabled.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package configuration

import (
"context"
"time"

"github.com/buildbarn/bb-remote-execution/pkg/filesystem/virtual"
Expand Down Expand Up @@ -99,10 +100,17 @@ func (m *fuseMount) Expose(terminationGroup program.Group, rootDirectory virtual
if err != nil {
return util.StatusWrap(err, "Failed to create FUSE server")
}
// TODO: Run this as part of the program.Group, so that it gets
// cleaned up upon shutdown.

go server.Serve()

terminationGroup.Go(func(ctx context.Context, siblingsGroup, dependenciesGroup program.Group) error {
<-ctx.Done()
if err := server.Unmount(); err != nil {
return util.StatusWrapf(err, "Failed to unmount %#v", m.mountPath)
}
return nil
})

// Adjust configuration options that can only be set after the
// FUSE server has been launched.
if err := fuse.SetLinuxBackingDevInfoTunables(
Expand Down
Loading