Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-57638

block_rss_client does not respect skiptime and skipuntil values

    XMLWordPrintable

Details

    • MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • MOODLE_33_STABLE
    • MDL-57638_rss_skip
    • Hide

      A little difficult to test, but try the following:

      You need to get a failing RSS feed, one way to this is:

      • Download into your local moodle the rss test file: https://raw.githubusercontent.com/moodlehq/moodle-exttests/master/behat-rsstest.xml
      • Add the RSS block to a page
      • Add the local feed you setup (e.g. http://127.0.0.1/pm/behat-rsstest.xml )[1]
      • View the block
      • Remove the rss test file so now the feed starts to fail
      • Run the cron task
      • The cron output should mention setting a fail delay "Error: could not load/find the RSS feed - skipping for 330 seconds."
      • View the block again
      • The server should not attempt to access the RSS feed address (hard to verify)
      • VERIFY There should be a note in the block footer about failed feeds
      • Click the link to go to the manage feeds page
      • VERIFY: There is a note about the failed feed
      • VERIFY: As a student, the note about the failed feeds should not be displayed
      • Add the rss test file back
      • Run cron until the RSS feed is checked again
      • View the block - the RSS feed content should appear

      [1] Make sure your curl security settings don't restirct local urls like thais

      Show
      A little difficult to test, but try the following: You need to get a failing RSS feed, one way to this is: Download into your local moodle the rss test file: https://raw.githubusercontent.com/moodlehq/moodle-exttests/master/behat-rsstest.xml Add the RSS block to a page Add the local feed you setup (e.g. http://127.0.0.1/pm/behat-rsstest.xml ) [1] View the block Remove the rss test file so now the feed starts to fail Run the cron task The cron output should mention setting a fail delay "Error: could not load/find the RSS feed - skipping for 330 seconds." View the block again The server should not attempt to access the RSS feed address (hard to verify) VERIFY There should be a note in the block footer about failed feeds Click the link to go to the manage feeds page VERIFY: There is a note about the failed feed VERIFY: As a student, the note about the failed feeds should not be displayed Add the rss test file back Run cron until the RSS feed is checked again View the block - the RSS feed content should appear [1] Make sure your curl security settings don't restirct local urls like thais

    Description

      We have seen that block_rss_client does not respect skiptime and skipuntil values in a feed's entry in the mdl_block_rss_client table.

      Steps to replicate:

      • Add an instance of block_rss_client onto a Moodle page, for example onto the Moodle frontpage.
      • Add a feed URL to the block instance which will not return a valid feed.
      • Wait for the Moodle cron to process the feed multiple times until the cron has set the skiptime and skipuntil values in the feed's entry in the mdl_block_rss_client table because no valid feed couldn't be found (see MDL-44273 for the RSS feed back-off strategy).
      • Open the Moodle page where you placed the block instance in your browser.

      Expected result:

      • We would expect that the block_rss_client instance does not try to fetch the RSS feed from the feed source as the feed cache is outdated (or more precisely: does not exist at all) and skiptime / skipuntil values are set.
      • We would expect that the content of the block instance is empty because there are no feed entries cached.
      • We would even expect that a block_rss_client instance does never fetch RSS Feeds from the feed source at all, even if the feed is not cached, for the sake of page load times, and would wait for the Moodle cron to fill the feed cache.

      Actual result:

      • The block_rss_client instance does not respect the skiptime / skipuntil values and tries to fetch the RSS feed from the feed source everytime the block instance is displayed. This behaviour can be proven by looking at the outbound connections of the webserver with tcpdump or a similar tool.
      • This is at least unthrifty but might also dramatically increase the page load time of this Moodle page if the block instance has to wait for a timeout of a broken feed source.

      Note:
      We have seen this behavior in production in 3.0, but expect it to be present in 3.2 as well.

      Attachments

        Issue Links

          Activity

            People

              davosmith Davo Smith
              abias Alexander Bias
              Dan Poltawski Dan Poltawski
              Andrew Lyons Andrew Lyons
              John Okely John Okely
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                15/May/17