Hide Forgot
Description of problem: I was trying different sync scenarios. So I cancelled the running sync. The status immediately changed to 'cancelled' on UI. However after few minutes, I re-sync the same repo and on completion sync status remains 'cancelled'. However this should be changed to 'Sync complete' Version-Release number of selected component (if applicable): katello-0.1.211-1.el6.noarch pulp-0.0.264-1.el6.noarch How reproducible: always Steps to Reproduce: 1. sync a repo 2. cancel the sync 3. Re-sync the same repo Actual results: On re-sync completion, sync status remains cancelled Expected results: Re-running the cancelled sync on completion, should change the status from 'cancelled" to 'sync complete' Additional info:
Created attachment 559031 [details] status remains cencelled on sync completion
starting a sync should clear the previous status....
very good catch on this one. this was a bit tricky. there were two issues which made this a bit confusing since i could not always duplicate. 1) we can't rely on order for the sync history objects that come back from pulp. we need to order them 2) we were accidentally popping the stack in our lower api layers and therefore losing the 'finished' data when the pulp list was not in order working on a fix
c611fda..54db6b5 master -> master
Had to revert since fix seems to have caused 790246
tried sorting the sync status history based on finish time. that seemed to fix this problem but also introduced other problems that were worse so backed it out. moving on to other bugs for now and will revisit. diff --git a/src/app/models/glue/pulp/repo.rb b/src/app/models/glue/pulp/repo.rb index 2cd8856..573fa59 100644 --- a/src/app/models/glue/pulp/repo.rb +++ b/src/app/models/glue/pulp/repo.rb -422,7 +422,7 @@ module Glue::Pulp::Repo def sync_statuses @sync_status = self._get_most_recent_sync_status() if @sync_status.nil? - @sync_status + @sync_status.sort_by{|item| item.finish_time}.reverse end def sync_state diff --git a/src/lib/resources/pulp.rb b/src/lib/resources/pulp.rb index f714b64..035b2d6 100644 --- a/src/lib/resources/pulp.rb +++ b/src/lib/resources/pulp.rb -284,7 +284,7 @@ module Pulp response = get(path, self.default_headers) parsed = JSON.parse(response.body) return parsed if parsed.empty? - return parsed.first.with_indifferent_access + return parsed.with_indifferent_access end
problem with above is active syncs will have a finish_time of nil so we can blindly sort just on finish_time. explains why it fixes original issue but erratically busts active syncs.
Assigning to jsherrill since Shannon is no longer on the team.
mass move ON_QA after brewing
QA Verified: 0.1.303-1.el6
getting rid of 6.0.0 version since that doesn't exist