fix the CanvasHttp::Error superclass
It was inheriting from Exception, so the rescue clause in external_feed_aggregator.rb wasn't catching it, causing the entire ExternalFeedAggregator.process job to fail. Looking at the other uses of CanvasHttp, I see no reason to believe that this was intentional. closes CNVS-21213 Test plan: as mentioned above the problem here is that when an ExternalFeed throws this error, it was not being caught properly and so all external feeds afterwards in the queue would not be processed. In order to recreate these conditions we need a feed that fails and then we need to make sure there are more feeds afterwards in the queue. - First add a valid rss external feed. We'll use this just to make sure the system is working. - Then add a url (doesn't even have to be to an rss feed) that redirects more than 3 times before resolving. This will trigger the redirect error, that was causing the problem. You can verify if a url will break by running CanvasHttp.get('http://broken.redirects') in a rails console - Then add another valid rss feed. This will be the one that comes after the broken one, and it working successfully is what we're looking for. - The system loads feeds to check in order of a "refresh_date" which is initially set to the time they were created, and then reset to the last time they were updated. This is why the order of creation is important above, because we'll create a refresh order that has a valid feed after a broken feed. - The feed import system is set up to ignore rss entries that were created before the feed object was created. To get around this, you can manually update the created_at time of these objects. Find a time that is before the last entry in the two valid feeds, and run: `ExternalFeed.update_all(created_at: 6.hours.ago)` - Finally we're set, just run this in the console, to simulate the delayed job that runs: `ExternalFeedAggregator.process` - And ensure that new entries from both the first and third feeds are imported. Change-Id: If60158719d1b618c1e706ea0d056bc6b08f87457 Reviewed-on: https://gerrit.instructure.com/53494 Reviewed-by: Simon Williams <simon@instructure.com> Tested-by: Jenkins QA-Review: Jeremy Putnam <jeremyp@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
This commit is contained in:
parent
f9aff37bf1
commit
554789efbf
|
@ -1,7 +1,7 @@
|
|||
require 'uri'
|
||||
|
||||
module CanvasHttp
|
||||
class Error < ::Exception; end
|
||||
class Error < ::StandardError; end
|
||||
class TooManyRedirectsError < CanvasHttp::Error; end
|
||||
class InvalidResponseCodeError < CanvasHttp::Error
|
||||
attr_reader :code
|
||||
|
|
Loading…
Reference in New Issue