Project

General

Profile

Actions

Bug #2534

closed

util::dns::asyncResolve timeouts are not "real"

Added by Alex Afanasyev about 9 years ago. Updated over 8 years ago.

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

100%

Estimated time:
0.50 h

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().

Actions

Also available in: Atom PDF