diff --git a/ChangeLog b/ChangeLog index 0439a65b..b52fc9e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-03-08 Tatsuhiro Tsujikawa + + Fixed the bug that FillRequestGroupCommand is not invoked when + RequestGroupMan::createInitialCommand() creates no Command object. + * src/FillRequestGroupCommand.cc + * src/RequestGroupMan.cc + 2010-03-08 Tatsuhiro Tsujikawa Added debug logs. diff --git a/src/FillRequestGroupCommand.cc b/src/FillRequestGroupCommand.cc index 13d53c7f..34f56f3e 100644 --- a/src/FillRequestGroupCommand.cc +++ b/src/FillRequestGroupCommand.cc @@ -64,10 +64,16 @@ bool FillRequestGroupCommand::execute() SharedHandle rgman = _e->_requestGroupMan; if(rgman->queueCheckRequested()) { try { - rgman->fillRequestGroupFromReserver(_e); + // During adding RequestGroup, + // RequestGroupMan::requestQueueCheck() might be called, so + // first clear it here. rgman->clearQueueCheck(); + rgman->fillRequestGroupFromReserver(_e); } catch(RecoverableException& ex) { logger->error(EX_EXCEPTION_CAUGHT, ex); + // Re-request queue check to fulfill the requests of all + // downloads, some might come after this exception. + rgman->requestQueueCheck(); } if(rgman->downloadFinished()) { return true; diff --git a/src/RequestGroupMan.cc b/src/RequestGroupMan.cc index c71c77c0..5c772d9a 100644 --- a/src/RequestGroupMan.cc +++ b/src/RequestGroupMan.cc @@ -516,6 +516,9 @@ void RequestGroupMan::fillRequestGroupFromReserver(DownloadEngine* e) configureRequestGroup(groupToAdd); createInitialCommand(groupToAdd, commands, e); groupToAdd->setRequestGroupMan(this); + if(commands.empty()) { + requestQueueCheck(); + } _requestGroups.push_back(groupToAdd); ++count; e->addCommand(commands);