Project

General

Profile

Actions

Feature #4692

closed

SegmentFetcher: allow applications to stop/cancel fetch

Added by Ashlesh Gawande over 5 years ago. Updated almost 4 years ago.

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

100%

Estimated time:
Tags:

Description

SegmentFetcher::start returns a shared_ptr, but this shared_ptr is kept alive internally by the SegmentFetcher instance itself, so even if the returned shared_ptr goes out of scope, the SegmentFetcher is not destructed.

In PSync #4662 (and maybe NLSR #4682) when a test completes successfully without error, ASan and valgrind reports leak due to segment fetcher start being called such that there is no expectation of data (start is called because the application is supposed to send the interest upon getting data).
The io is already stopped given that the test is successfully terminated. If advanceClocks is run for 60 seconds (maxTimeout) the segment fetcher destructs and no leaks are reported.

If a stop/cancel function is provided it can be called in the application's destructor.

Another use case is when a previous interest needs to be cancelled and a new interest needs to be sent in its place.


Files

heap-free-after-use.txt (13.7 KB) heap-free-after-use.txt Ashlesh Gawande, 09/01/2018 09:05 PM
asan (15.7 KB) asan Ashlesh Gawande, 10/02/2018 05:41 PM

Related issues 4 (2 open2 closed)

Related to ndn-cxx - Feature #4776: Re-design SegmentFetcherNew

Actions
Blocks ndn-tools - Task #4637: ndncatchunks: use SegmentFetcherNew

Actions
Blocks PSync - Feature #4662: Segment hello and sync data in partial syncClosed07/12/2018

Actions
Blocks PSync - Task #4716: Segment sync data in full syncClosed

Actions
Actions

Also available in: Atom PDF