Bug #3724
closed
Face: bad_function_call when InterestCallback/DataCallback/NackCallback is empty
Added by Junxiao Shi over 8 years ago.
Updated over 8 years ago.
Description
Steps to reproduce (1):
- invoke
Face::setInterestFilter
with InterestCallback
set to nullptr
- invoke
Face::processEvents
- cause the face to receive an Interest that matches the filter
Steps to reproduce (2):
- invoke
Face::expressInterest
with DataCallback
set to nullptr
- invoke
Face::processEvents
- answer the Interest with a Data
Steps to reproduce (2):
- invoke
Face::expressInterest
with NackCallback
set to nullptr
- invoke
Face::processEvents
- answer the Interest with a Nack
Actual: throw std::bad_function_call
Expected: no such error
- Status changed from New to In Progress
- Assignee set to Junxiao Shi
- Estimated time set to 1.00 h
- Status changed from In Progress to Code review
- % Done changed from 0 to 100
- Blocks Bug #3702: TopologyTester: does not process Nack added
- Blocks Bug #3703: AccessStrategy test suite: does not process Nack added
This is not an issue for me. Don't call expressInterest with nullptr callbacks, which don't makes much sense to me.
Even if such behavior is allowed, it should be implemented as a check inside expressInterest, not at the call time.
Alex Afanasyev wrote:
This is not an issue for me. Don't call expressInterest with nullptr callbacks, which don't makes much sense to me.
It's just for convenience... the check is cheap, and makes the API easier to use (it "just works").
The other direction to go is to forbid nullptr
for all callbacks (except onTimeout
on deprecated expressInterest
), and assert this condition. There's no reason to require callbacks on Data and Nack, but not require callback on timeout.
Please let me know how to proceed.
Benchmark for https://gerrit.named-data.net/3043 patchset3:
Vagrant Ubuntu xenial 32-bit, debug build, static linking, execute time build/unit-tests -t TestFace
three times
before: 53642ms, 55785ms, 46764ms
after: 4922ms, 3758ms, 3318ms
- Status changed from Code review to Closed
Also available in: Atom
PDF