Project

General

Profile

Feature #4581

Default CanBePrefix declaration

Added by Junxiao Shi over 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Base
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
6.00 h

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.".


Related issues

Blocks ndn-cxx - Feature #4582: Switch default CanBePrefix to 0New

Actions

History

#1

Updated by Junxiao Shi over 1 year 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
#2

Updated by Junxiao Shi over 1 year 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.

#3

Updated by Junxiao Shi over 1 year ago

  • % Done changed from 30 to 40
#4

Updated by Junxiao Shi over 1 year ago

  • % Done changed from 40 to 60
#5

Updated by Junxiao Shi over 1 year 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).

#6

Updated by Davide Pesavento about 1 year ago

  • translation missing: en.field_tag_list set to Packet03Transition
#7

Updated by Junxiao Shi 11 months 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

#8

Updated by Davide Pesavento 11 months ago

ndn-autoconfig still triggers the warning... and then there are tons of NFD unit tests to fix :-/

#9

Updated by Davide Pesavento 11 months 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.

#10

Updated by Junxiao Shi 11 months 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.

#11

Updated by Davide Pesavento 11 months 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.

#12

Updated by Davide Pesavento 8 months 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 until Interest::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.

#13

Updated by Junxiao Shi 7 months 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.

#14

Updated by Junxiao Shi 7 months ago

  • Start date deleted (04/13/2018)

https://gerrit.named-data.net/5453 clears all CanBePrefix warnings from NFD unit-tests-tools.

#15

Updated by Davide Pesavento 5 months ago

What's left?

#16

Updated by Davide Pesavento 5 months ago

#17

Updated by Junxiao Shi 5 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

Also available in: Atom PDF