Skip to content

Commit

Permalink
Fix LocalTrajectoryUploader recovery (#1415)
Browse files Browse the repository at this point in the history
Make sure no data is uploaded to an interrupted uplink trajectory,
but create a new uplink trajectory to upload to that one.
  • Loading branch information
gaschler committed Sep 10, 2018
1 parent a351a8e commit 1ddfd9c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cartographer/cloud/internal/local_trajectory_uploader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1ddfd9c

Please sign in to comment.