Moodle

add optional timeout estimation to file_storage.php download_file_content() based on header with file size as it reportedly blocks upgrade.

Details

Description

the has been a report about an upgrade going awry based on timeouts as initially reported in MDL-26580 at
http://tracker.moodle.org/browse/MDL-26580?focusedCommentId=106462&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-106462
(near 'file_storage.php')

The approach in that bug was to help alleviate upgrading timeout pains however the solution was partially integrated leaving out the timeout estimation for scrom/locallib.php:create_file_from_url() -> donwload_file_content().

This bug is about a improving the suggested fix in MDL-26580.

SamH and Eloy have discussed and suggested that its better to have timeouts as an option, something like:

/lib/filestorage/file_storage.php:694:
public function create_file_from_url($file_record, $url, array $options = NULL, $usetempfile = false, $usetimeout = false)

./mod/scorm/locallib.php:189:
if ($packagefile = $fs->create_file_from_url($file_record, $scorm->reference, true)) {

./lib/filelib.php:923:
function download_file_content($url, $headers=null, $postdata=null, $fullresponse=false, $timeout=300, $connecttimeout=20, $skipcertverify=false, $tofile=NULL, $calctimeout= false) {

followed by some similar timeout code : https://github.com/nebgor/moodle/commit/2a083e9774dbd6b7d258d346fa319a918645e05b

Issue Links

Activity

Hide
Aparup Banerjee added a comment -

linking bug created for secondary files timeout issue

Show
Aparup Banerjee added a comment - linking bug created for secondary files timeout issue
Hide
Aparup Banerjee added a comment -

there a reconstructed branch here with suggestions in place:
https://github.com/nebgor/moodle/compare/mistress...MDL-27251

Show
Aparup Banerjee added a comment - there a reconstructed branch here with suggestions in place: https://github.com/nebgor/moodle/compare/mistress...MDL-27251
Hide
Aparup Banerjee added a comment -

ok here is the cleaned up code: https://github.com/nebgor/moodle/compare/mistress...MDL-27251_cleaned_up
now lets see how this modified development process works.. hmm..

Show
Aparup Banerjee added a comment - ok here is the cleaned up code: https://github.com/nebgor/moodle/compare/mistress...MDL-27251_cleaned_up now lets see how this modified development process works.. hmm..
Hide
Sam Hemelryk added a comment -

Thanks Apu, this has been integrated now.
I did make three changes during integration:

  1. I fixed a broken string (the help string for the new setting)
  2. Cleaned up a little bit of white space
  3. Reworded the new strings

Cheers
Sam

Show
Sam Hemelryk added a comment - Thanks Apu, this has been integrated now. I did make three changes during integration:
  1. I fixed a broken string (the help string for the new setting)
  2. Cleaned up a little bit of white space
  3. Reworded the new strings
Cheers Sam
Hide
Andrew Davis added a comment -

1.9 to 2.0 upgrade process is pretty epic when you do the whole thing in one go. Went through it without a hitch however.

Show
Andrew Davis added a comment - 1.9 to 2.0 upgrade process is pretty epic when you do the whole thing in one go. Went through it without a hitch however.
Hide
Eloy Lafuente (stronk7) added a comment -

Closing as fixed. Many (exactly $CFG->bitrate) thanks! :-P

Show
Eloy Lafuente (stronk7) added a comment - Closing as fixed. Many (exactly $CFG->bitrate) thanks! :-P

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved:
    Integration date: