Project

General

Profile

Feature #5169

nfdc: execute a batch of commands defined in a separate file

Added by Alex Afanasyev 4 months ago. Updated 4 months ago.

Status:
In Progress
Priority:
Normal
Category:
Tools
Target version:
Start date:
06/09/2021
Due date:
% Done:

60%

Estimated time:

Description

At least until we change how a large number of commands is processed by NFD, we need to accomodate case when nfdc is used to create multiple faces/routes at once. The current solution of executing nfdc multiple times faces an issue of command being rejected, as there is no state kept between individual executions of nfdc and signature may include the same timestamp (and as such, deemed invalid), e.g., when running on a powerful machine.

This feature is a simple modification to nfdc to allow multiple commands to be executed while preserving the signing state, thus creating signatures that will not be incorrectly rejected by the validator.


Related issues

Related to NFD - Feature #2542: Redesign nfdc combining nfdc and nfd-statusClosedJunxiao Shi

Actions
Related to NFD - Bug #4511: Failure of RIB register commands within short period of time Rejected

Actions
#1

Updated by Junxiao Shi 4 months ago

Design questions:

If one of the commands contains a syntax error, should nfdc validate all the commands before trying to execute the batch?

If one of the commands is syntactically correct but has an execution failure (e.g. strategy set with a non-existent strategy), should nfdc continue executing the next commands or terminate?

#2

Updated by Alex Afanasyev 4 months ago

https://gerrit.named-data.net/c/NFD/+/6445

One thing I wasn't sure whether to proceed executing commands after an error or abort. Right now, the commands are aborted. Exception is the case when issue is in format of the command, which will just stop processing and will not execute commands at all.

^ this also an answer to Junxiao's question.

#3

Updated by Davide Pesavento 4 months ago

  • Related to Feature #2542: Redesign nfdc combining nfdc and nfd-status added
#4

Updated by Davide Pesavento 4 months ago

  • Subject changed from Allow nfdc execute batch of commands defined in a separate file to nfdc: execute a batch of commands defined in a separate file
  • Status changed from New to In Progress
#5

Updated by Davide Pesavento 4 months ago

The obvious (and safer) choice is to stop executing the list of commands as soon as one fails (and return its exit code). We can extend the format later to ignore the exit status of a command and continue through the list (e.g. prefix the command with "-" like in make).

#6

Updated by Davide Pesavento 4 months ago

Will each command be printed before being executed? If so, we could also add a "@" prefix to suppress echoing the command (or the reverse: not print by default unless "@" is specified). Just an idea...

#7

Updated by Davide Pesavento 4 months ago

  • Related to Bug #4511: Failure of RIB register commands within short period of time added

Also available in: Atom PDF