Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLazyDirectory ¶
func NewLazyDirectory(directoryOpener DirectoryOpener) filesystem.Directory
NewLazyDirectory creates a directory handle that forwards all calls to a directory that is created on demand. The primary use case for this adapter is for the FUSE-based runner.
A runner process may get started before the worker is able to create its FUSE mount point. This would cause the runner to obtain a handle to the build directory underneath the FUSE mount, causing builds to fail due to missing input files.
Relatedly, if the worker would start before the runner, but end up crashing/restarting, the runner would still have a directory handle pointing to a stale FUSE mount.
This wrapper prevents these problems by ensuring that we never hold on to a file descriptor to the build directory.
Types ¶
type DirectoryOpener ¶
type DirectoryOpener func() (filesystem.DirectoryCloser, error)
DirectoryOpener is a callback that is used by LazyDirectory to open the underlying directory on demand.