From 1ddfd9c6d383f8c88ab34f5bbe160dc74199add1 Mon Sep 17 00:00:00 2001 From: gaschler Date: Mon, 10 Sep 2018 12:03:10 +0200 Subject: [PATCH] Fix LocalTrajectoryUploader recovery (#1415) Make sure no data is uploaded to an interrupted uplink trajectory, but create a new uplink trajectory to upload to that one. --- cartographer/cloud/internal/local_trajectory_uploader.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cartographer/cloud/internal/local_trajectory_uploader.cc b/cartographer/cloud/internal/local_trajectory_uploader.cc index da7f85f..99fffb6 100644 --- a/cartographer/cloud/internal/local_trajectory_uploader.cc +++ b/cartographer/cloud/internal/local_trajectory_uploader.cc @@ -183,6 +183,14 @@ void LocalTrajectoryUploader::TryRecovery() { } } + // Because the trajectories may be interrupted on the uplink side, we can no + // longer upload to those. + for (auto& entry : local_trajectory_id_to_trajectory_info_) { + entry.second.uplink_trajectory_id.reset(); + } + // TODO(gaschler): If the uplink did not restart but only the connection was + // interrupted, this leaks trajectories in the uplink. + // Attempt to recreate the trajectories. for (const auto& entry : local_trajectory_id_to_trajectory_info_) { grpc::Status status = RegisterTrajectory(entry.first);