Feature #4581
closedDefault CanBePrefix declaration
100%
Description
In early phase of Packet03Transition, Interest
constructor sets CanBePrefix=1 by default, which matches Interest v0.2 behavior. Eventually, the default would be switched to CanBePrefix=1 (#4582).
To prepare applications for the switchover and avoid breaking applications that depend on CanBePrefix=1 being the default, this issue introduces Interest::setDefaultCanBePrefix
static function.
Every application SHOULD declare its default by calling this function. If an application uses Interest
constructor without declaring a default CanBePrefix setting, print a warning message to stderr once: "Interest.CanBePrefix will be set to 0 in the near future. Please declare a preferred setting via Interest::setDefaultCanBePrefix
.".
Updated by Junxiao Shi over 6 years ago
- Category set to Base
- Status changed from New to In Progress
- Assignee set to Junxiao Shi
- Target version set to v0.7
- Estimated time set to 2.00 h
Updated by Junxiao Shi over 6 years ago
- % Done changed from 0 to 30
- Estimated time changed from 2.00 h to 6.00 h
https://gerrit.named-data.net/4767 adds the Interest::setDefaultCanBePrefix
function.
I realize that it would be a bad idea to print the warning in Interest
contructor, because that means a simple default-construction results in a warning. Thus, the warning is delayed until Interest::wireEncode
.
I also realize that ndn-cxx itself cannot call Interest::setDefaultCanBePrefix
, because that would conflict the application's choice and mask the application's negligence. Thus, I'll have to review all Interests expressed by ndn-cxx's mgmt security util
and set CanBePrefix on a per-Interest basis, so that ndn-cxx itself does not trigger the warning.
Updated by Junxiao Shi over 6 years ago
- % Done changed from 60 to 70
https://gerrit.named-data.net/#/c/ndn-tools/+/4910 sets CanBePrefix to appropriate values in ndn-tools, except chunks (#4556) and pib (#4205).
Updated by Junxiao Shi almost 6 years ago
- % Done changed from 70 to 80
Most of PSync express Interests through SegmentFetcher
except one place: https://gerrit.named-data.net/5115
ChronoSync already has setCanBePrefix
everywhere.
NLSR needs setCanBePrefix
in several test suites: https://gerrit.named-data.net/5116
Updated by Davide Pesavento almost 6 years ago
ndn-autoconfig
still triggers the warning... and then there are tons of NFD unit tests to fix :-/
Updated by Davide Pesavento almost 6 years ago
I'm wondering if "fixing" all the test cases (i.e. adding an explicit setCanBePrefix(true/false)
) is a good use of our time. We could simply wait until the default is flipped, and only then fix those tests that fail by adding setCanBePrefix(true)
. My assumption is that those tests will be a small fraction of the total.
Updated by Junxiao Shi almost 6 years ago
ndn-autoconfig
still triggers the warning... and then there are tons of NFD unit tests to fix :-/
I do not intend to fix NFD and its unit tests. NFD forwarding needs to process packets in v0.3 semantics before its tests can set CanBePrefix to either value. Before then, the warning remains with NFD.
Other programs in NFD repository should be fixed in the same way as PSync, etc.
Updated by Davide Pesavento almost 6 years ago
Junxiao Shi wrote:
I do not intend to fix NFD and its unit tests. NFD forwarding needs to process packets in v0.3 semantics before its tests can set CanBePrefix to either value. Before then, the warning remains with NFD.
For forwarding tests I agree, but some warnings are triggered by tests that have nothing to do with forwarding, e.g. I've seen warnings in LinkService, Management, etc.
Updated by Davide Pesavento over 5 years ago
Junxiao Shi wrote:
https://gerrit.named-data.net/4767 adds the
Interest::setDefaultCanBePrefix
function.I realize that it would be a bad idea to print the warning in
Interest
contructor, because that means a simple default-construction results in a warning. Thus, the warning is delayed untilInterest::wireEncode
.
The warning is printed twice because the static guard variable is in the scope of a function template which is instantiated twice, so you end up with two separate variables.
The warning message also lacks a trailing newline.
Updated by Junxiao Shi over 5 years ago
- % Done changed from 80 to 90
https://gerrit.named-data.net/5442 clears all CanBePrefix warnings from unit-tests-daemon
.
unit-tests-core
and unit-tests-rib
do not trigger the warning.
unit-tests-tools
will be handled in another commit.
Updated by Junxiao Shi over 5 years ago
- Start date deleted (
04/13/2018)
https://gerrit.named-data.net/5453 clears all CanBePrefix warnings from NFD unit-tests-tools
.
Updated by Davide Pesavento over 5 years ago
- Blocks Task #4582: Switch default CanBePrefix to false added
Updated by Junxiao Shi over 5 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100