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.
master
gaschler 2018-09-10 12:03:10 +02:00 committed by GitHub
parent a351a8e3b4
commit 1ddfd9c6d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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. // Attempt to recreate the trajectories.
for (const auto& entry : local_trajectory_id_to_trajectory_info_) { for (const auto& entry : local_trajectory_id_to_trajectory_info_) {
grpc::Status status = RegisterTrajectory(entry.first); grpc::Status status = RegisterTrajectory(entry.first);