Merge lp:~thomas-voss/location-service/fix-1462664 into lp:location-service/15.04

Proposed by Thomas Voß
Status: Superseded
Proposed branch: lp:~thomas-voss/location-service/fix-1462664
Merge into: lp:location-service/15.04
Diff against target: 93 lines (+25/-26)
2 files modified
src/location_service/com/ubuntu/location/service/daemon.cpp (+4/-23)
src/location_service/com/ubuntu/location/service/session/skeleton.cpp (+21/-3)
To merge this branch: bzr merge lp:~thomas-voss/location-service/fix-1462664
Reviewer Review Type Date Requested Status
Alberto Mardegan (community) Approve
Review via email: mp+275449@code.launchpad.net

This proposal has been superseded by a proposal from 2015-10-23.

Commit message

Handle responses of clients to updates asynchronously.

Description of the change

Handle responses of clients to updates asynchronously.

To post a comment you must log in.
Revision history for this message
Alberto Mardegan (mardy) wrote :

All the messages say "Failed to communicate position update to client: ", but the last two could say "heading" and "velocity", respectively. Just in case we want to be able to tell apart the cases in the logs.

Which I don't think is really important, that's why I'm approving this as it is anyway.

review: Approve
Revision history for this message
Alberto Mardegan (mardy) wrote :

But, how does this fixes the linked issues? The methods where already invoked asynchronously; this just adds error logging (which is good).

Revision history for this message
Thomas Voß (thomas-voss) wrote :

The previous *async* methods returned a std::future<core::dbus::Result<..>>, which tries to synchronize its state on destruction. Please also note that I'm proposing this early to enable testing easily.

199. By Thomas Voß

Redirect all positions available for harvesting to /dev/null(reporter).

In addition, we switch to using a dummy impl. of connectivity::Manager. We do not
need information about connectivity state of the system and minimize risk of getting
confused due to incoming updates.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/location_service/com/ubuntu/location/service/daemon.cpp'
--- src/location_service/com/ubuntu/location/service/daemon.cpp 2015-04-16 10:03:29 +0000
+++ src/location_service/com/ubuntu/location/service/daemon.cpp 2015-10-23 13:45:46 +0000
@@ -20,6 +20,8 @@
20#include <com/ubuntu/location/boost_ptree_settings.h>20#include <com/ubuntu/location/boost_ptree_settings.h>
21#include <com/ubuntu/location/provider_factory.h>21#include <com/ubuntu/location/provider_factory.h>
2222
23#include <com/ubuntu/location/connectivity/dummy_connectivity_manager.h>
24
23#include <com/ubuntu/location/service/default_configuration.h>25#include <com/ubuntu/location/service/default_configuration.h>
24#include <com/ubuntu/location/service/demultiplexing_reporter.h>26#include <com/ubuntu/location/service/demultiplexing_reporter.h>
25#include <com/ubuntu/location/service/ichnaea_reporter.h>27#include <com/ubuntu/location/service/ichnaea_reporter.h>
@@ -214,29 +216,8 @@
214 dc.the_permission_manager(config.outgoing),216 dc.the_permission_manager(config.outgoing),
215 location::service::Harvester::Configuration217 location::service::Harvester::Configuration
216 {218 {
217 location::connectivity::platform_default_manager(),219 std::make_shared<dummy::ConnectivityManager>(),
218 // We submit location/wifi/cell measurements to both220 std::make_shared<NullReporter>()
219 // Mozilla's location service and to Ubuntu's own instance.
220 std::make_shared<service::DemultiplexingReporter>(
221 std::initializer_list<service::Harvester::Reporter::Ptr>
222 {
223 std::make_shared<service::ichnaea::Reporter>(
224 service::ichnaea::Reporter::Configuration
225 {
226 "https://location.services.mozilla.com",
227 "UbuntuLocationService",
228 "UbuntuLocationService"
229 }
230 ),
231 std::make_shared<service::ichnaea::Reporter>(
232 service::ichnaea::Reporter::Configuration
233 {
234 "https://162.213.35.107",
235 "UbuntuLocationService",
236 "UbuntuLocationService"
237 }
238 )
239 })
240 }221 }
241 };222 };
242223
243224
=== modified file 'src/location_service/com/ubuntu/location/service/session/skeleton.cpp'
--- src/location_service/com/ubuntu/location/service/session/skeleton.cpp 2014-08-14 20:31:09 +0000
+++ src/location_service/com/ubuntu/location/service/session/skeleton.cpp 2015-10-23 13:45:46 +0000
@@ -283,7 +283,13 @@
283 VLOG(10) << __PRETTY_FUNCTION__;283 VLOG(10) << __PRETTY_FUNCTION__;
284 try284 try
285 {285 {
286 configuration.remote.object->invoke_method_asynchronously<culs::session::Interface::UpdatePosition, void>(position);286 configuration.remote.object->invoke_method_asynchronously_with_callback<culs::session::Interface::UpdatePosition, void>([](const core::dbus::Result<void>& result)
287 {
288 if (result.is_error())
289 {
290 LOG(INFO) << "Failed to communicate position update to client: " << result.error().print();
291 }
292 }, position);
287 } catch(const std::exception&)293 } catch(const std::exception&)
288 {294 {
289 // We consider the session to be dead once we hit an exception here.295 // We consider the session to be dead once we hit an exception here.
@@ -300,7 +306,13 @@
300 VLOG(10) << __PRETTY_FUNCTION__;306 VLOG(10) << __PRETTY_FUNCTION__;
301 try307 try
302 {308 {
303 configuration.remote.object->invoke_method_asynchronously<culs::session::Interface::UpdateHeading, void>(heading);309 configuration.remote.object->invoke_method_asynchronously_with_callback<culs::session::Interface::UpdateHeading, void>([](const core::dbus::Result<void>& result)
310 {
311 if (result.is_error())
312 {
313 LOG(INFO) << "Failed to communicate position update to client: " << result.error().print();
314 }
315 }, heading);
304 } catch(const std::exception&)316 } catch(const std::exception&)
305 {317 {
306 // We consider the session to be dead once we hit an exception here.318 // We consider the session to be dead once we hit an exception here.
@@ -317,7 +329,13 @@
317 VLOG(10) << __PRETTY_FUNCTION__;329 VLOG(10) << __PRETTY_FUNCTION__;
318 try330 try
319 {331 {
320 configuration.remote.object->invoke_method_asynchronously<culs::session::Interface::UpdateVelocity, void>(velocity);332 configuration.remote.object->invoke_method_asynchronously_with_callback<culs::session::Interface::UpdateVelocity, void>([](const core::dbus::Result<void>& result)
333 {
334 if (result.is_error())
335 {
336 LOG(INFO) << "Failed to communicate position update to client: " << result.error().print();
337 }
338 }, velocity);
321 } catch(const std::exception&)339 } catch(const std::exception&)
322 {340 {
323 // We consider the session to be dead once we hit an exception here.341 // We consider the session to be dead once we hit an exception here.

Subscribers

People subscribed via source and target branches