Skip to content

Commit

Permalink
lib/repo-pull: Add some missing assertions for progress statistics
Browse files Browse the repository at this point in the history
Various of the counters already have assertions like this; add some more
for total paranoia.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1594
Approved by: jlebon
  • Loading branch information
pwithnall authored and rh-atomic-bot committed May 30, 2018
1 parent c9619a4 commit 78f4013
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libostree/ostree-repo-pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,7 @@ content_fetch_on_complete (GObject *object,
}

out:
g_assert (pull_data->n_outstanding_content_fetches > 0);
pull_data->n_outstanding_content_fetches--;

if (_ostree_fetcher_should_retry_request (local_error, fetch_data->n_retries_remaining--))
Expand Down Expand Up @@ -1168,6 +1169,7 @@ on_metadata_written (GObject *object,
queue_scan_one_metadata_object_c (pull_data, csum, objtype, fetch_data->path, 0, fetch_data->requested_ref);

out:
g_assert (pull_data->n_outstanding_metadata_write_requests > 0);
pull_data->n_outstanding_metadata_write_requests--;
fetch_object_data_free (fetch_data);

Expand Down

0 comments on commit 78f4013

Please sign in to comment.