Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      35163

      Description

      as commented in chat... we need something related to sessions in new stuff.

      Analyse the possibility to use $DB (will save one connection compared with current approach).

      And also the possibility of specify different $DB.

      just to avoid forgetting about it.

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment -

          adodb sessions are not working at all in 1.9.x and before, because it lacks session locking code (== multiple open windows or linked files override each others changes)
          we need something better in 2.0

          Show
          Petr Škoda added a comment - adodb sessions are not working at all in 1.9.x and before, because it lacks session locking code (== multiple open windows or linked files override each others changes) we need something better in 2.0
          Hide
          Jamie Pratt added a comment -

          Getting the following notices and warnings from tablelib code. They just started a few days ago after an update of HEAD :

          Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 360

          Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 361

          Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 362

          Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 363

          Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 364

          Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 365

          Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 368

          Warning: Attempt to assign property of non-object in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 417

          Show
          Jamie Pratt added a comment - Getting the following notices and warnings from tablelib code. They just started a few days ago after an update of HEAD : Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 360 Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 361 Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 362 Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 363 Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 364 Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 365 Notice: Indirect modification of overloaded property moodle_session::$flextable has no effect in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 368 Warning: Attempt to assign property of non-object in C:\Users\Pratt\workspace\moodle-HEAD\lib\tablelib.php on line 417
          Hide
          Petr Škoda added a comment -

          this is caused by http://bugs.php.net/bug.php?id=39449, grrrrrrrrrr

          working on a hack

          Show
          Petr Škoda added a comment - this is caused by http://bugs.php.net/bug.php?id=39449 , grrrrrrrrrr working on a hack
          Hide
          Petr Škoda added a comment -

          I hope this problem is now fixed in cvs

          Show
          Petr Škoda added a comment - I hope this problem is now fixed in cvs
          Hide
          Wen Hao Chuang added a comment -

          +1 for this, here at SFSU we running a really big site on a VM system (VMWare), and we are seeing some session-related issues that lead to slow performance....

          Show
          Wen Hao Chuang added a comment - +1 for this, here at SFSU we running a really big site on a VM system (VMWare), and we are seeing some session-related issues that lead to slow performance....
          Hide
          Petr Škoda added a comment -

          db sessions are now working fine for mysql and pg, not compatible with mssql and oracle

          Show
          Petr Škoda added a comment - db sessions are now working fine for mysql and pg, not compatible with mssql and oracle
          Hide
          Sam Marshall added a comment -

          As part of the change under this bug number, the following code was added:

          } else if ((!isset($CFG->dbsessions) or $CFG->dbsessions) and $DB->session_lock_supported())

          { // default recommended session type $session = new database_session(); }

          else {
          // legacy limited file based storage - some features and auth plugins will not work, sorry
          $session = new legacy_file_session();

          For performance we were thinking about moving to local disk-based sessions and it would definitely be nice to have this as an option! Questions:

          1) why do file sessions not work? do they really not work? is this documented somewhere as to what doesn't work? If so maybe the comment could include a link to the more detailed information. There is no info on legacy_file_session class either...

          2) this is at the least unfortunate, when file sessions are a good way to take load off overworked db server...

          (ok #2 that wasn't a question)

          Show
          Sam Marshall added a comment - As part of the change under this bug number, the following code was added: } else if ((!isset($CFG->dbsessions) or $CFG->dbsessions) and $DB->session_lock_supported()) { // default recommended session type $session = new database_session(); } else { // legacy limited file based storage - some features and auth plugins will not work, sorry $session = new legacy_file_session(); For performance we were thinking about moving to local disk-based sessions and it would definitely be nice to have this as an option! Questions: 1) why do file sessions not work? do they really not work? is this documented somewhere as to what doesn't work? If so maybe the comment could include a link to the more detailed information. There is no info on legacy_file_session class either... 2) this is at the least unfortunate, when file sessions are a good way to take load off overworked db server... (ok #2 that wasn't a question)
          Hide
          Petr Škoda added a comment -

          1/ file based sessions are problematic because you are not notified when the sessions expires - the file just gets deleted at some random time
          2/ it is not possible to "query" folder with file sessions
          3/ there are other way to off load db servers, for example shared memory

          Show
          Petr Škoda added a comment - 1/ file based sessions are problematic because you are not notified when the sessions expires - the file just gets deleted at some random time 2/ it is not possible to "query" folder with file sessions 3/ there are other way to off load db servers, for example shared memory
          Hide
          Sam Marshall added a comment -

          thanks.

          #1 why/in which places does moodle need to know when the session expires, i.e. what does this break?

          #2 why/in which places is the 'query' feature needed? This sounds like a dealbreaker for local file sessions as by definition it is not possible if they are stored locally and you have more than one server, however I don't understand why it would ever be necessary.

          #3 I thought sessions were written on every request? if this is the case then they will still cause very high DB load even if the reads are cached.

          Show
          Sam Marshall added a comment - thanks. #1 why/in which places does moodle need to know when the session expires, i.e. what does this break? #2 why/in which places is the 'query' feature needed? This sounds like a dealbreaker for local file sessions as by definition it is not possible if they are stored locally and you have more than one server, however I don't understand why it would ever be necessary. #3 I thought sessions were written on every request? if this is the case then they will still cause very high DB load even if the reads are cached.

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: