Reserve some disk space for the garbage collector
We can't open a SQLite database if the disk is full. Since this prevents the garbage collector from running when it's most needed, we reserve some dummy space that we can free just before doing a garbage collection. This actually revives some old code from the Berkeley DB days. Fixes #27.
This commit is contained in:
@@ -625,8 +625,12 @@ static void processConnection()
|
||||
throw Error("if you run `nix-worker' as root, then you MUST set `build-users-group'!");
|
||||
#endif
|
||||
|
||||
bool reserveSpace = true;
|
||||
if (GET_PROTOCOL_MINOR(clientVersion) >= 11)
|
||||
reserveSpace = readInt(from) != 0;
|
||||
|
||||
/* Open the store. */
|
||||
store = boost::shared_ptr<StoreAPI>(new LocalStore());
|
||||
store = boost::shared_ptr<StoreAPI>(new LocalStore(reserveSpace));
|
||||
|
||||
stopWork();
|
||||
to.flush();
|
||||
|
||||
Reference in New Issue
Block a user