Bug #2534
closedutil::dns::asyncResolve timeouts are not "real"
100%
Description
This is not an issue or feature, rather a report for util::dns::asyncResolve
(= boost::asio::basic_resolver
) "feature". Specifically, the timeouts that one can specify inside asyncResolve call are effective, but the asynchronous operation may not be finished after the timeout is fired and if io_service
is still running, may fire at some point later (even with success, which may cause segfaults in some cases...).
The documentation for basic_resolver
says that it has cancel
method that will cancel all pending async operations and we use this method inside the timeout event. However, this cancel does not work as we intended it to work (I actually, have no idea whether it does anything at all). In 2012 there was a related ticket with boost.asio 6138, which authors of asio considered not a bug but feature.
The impact of this "problem" should not be great, it is just applications needs to be aware that in order to abort io_service::run()
when asynchronous resolution times out, it is necessary to explicitly call io_service::stop()
.
Updated by Junxiao Shi over 9 years ago
- Tracker changed from Feature to Bug
This shall be a Bug because it might violate the assumption of certain applications.
To solve this Bug, add a \warning to asyncResolve function.
Updated by Junxiao Shi about 9 years ago
- Description updated (diff)
- Category set to Utils
Updated by Junxiao Shi about 9 years ago
20150901 conference call approves note-1 solution.
Updated by Junxiao Shi about 9 years ago
- Status changed from New to In Progress
- Assignee set to Junxiao Shi
- Target version set to v0.4
- Estimated time set to 0.50 h
Updated by Junxiao Shi about 9 years ago
- Status changed from In Progress to Code review
- % Done changed from 0 to 100
Updated by Junxiao Shi about 9 years ago
- Status changed from Code review to Closed