[Nix-dev] [PATCH] Allow recovery from isValidPath RPCs with an invalid path
Ludovic Courtès
ludo at gnu.org
Tue Mar 18 23:17:14 CET 2014
Hello,
Currently, clients cannot recover from an isValidPath RPC with an
invalid path parameter because the daemon closes the connection when
that happens.
More precisely:
1. in performOp, wopIsValidPath case, ‘readStorePath’ raises an
‘Error’ exception;
2. that exception is caught by the handler in ‘processConnection’;
3. the handler determines errorAllowed == false, and thus exits after
sending the message.
This last part is fixed by calling ‘startWork’ early on, as in the patch
below.
The same reasoning could be applied to all the RPCs that take one or
more store paths as inputs, but isValidPath is, by definition, likely to
be passed invalid paths in the first place, so it’s important for this
one to allow recovery.
WDYT?
Thanks,
Ludo’.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 810 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140318/dc9e3590/attachment.bin
More information about the nix-dev
mailing list