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

Set web services used by Timeline block to use read only sessions

XMLWordPrintable

    • MOODLE_402_STABLE
    • MOODLE_404_STABLE
    • MDL-79618_master
    • Hide
      1. In config.php, set `$CFG->enable_read_only_sessions_debug = true;`
      2. On your server, run `tail -f /var/log/error.log` where /var/log/error.log is the file your PHP error logs to go.
      3. Create a course set the start and end date so as to be in progress
      4. Add an activity with a date based completion
      5. Enrol a student
      6. Login as that student and check that the course is in progress in the dashboard
      7. Check the error log output on your server. Confirm there are no messages like " Script defined READ_ONLY_SESSION but the following SESSION attributes were changed".
      Show
      In config.php, set `$CFG->enable_read_only_sessions_debug = true;` On your server, run `tail -f /var/log/error.log` where /var/log/error.log is the file your PHP error logs to go. Create a course set the start and end date so as to be in progress Add an activity with a date based completion Enrol a student Login as that student and check that the course is in progress in the dashboard Check the error log output on your server. Confirm there are no messages like " Script defined READ_ONLY_SESSION but the following SESSION attributes were changed".

      During performance analysis on a large site, I found that web service calls to core_course_get_enrolled_courses_with_action_events_by_timeline_classification and core_calendar_get_action_events_by_timesort were sometimes holding long session locks. These are used by the timeline block and may take a couple of seconds on a big site.

      They do not appear to mutate the session. I tested adding 'readonlysession' => true to the service definitions and setting $CFG->enable_read_only_sessions_debug = true, and I was able to use the timeline block without generating any errors.

      I propose setting 'readonlysession' => true for both of these web services in lib/db/services.php

            marcusgreen Marcus Green
            marxjohnson Mark Johnson
            Mark Johnson Mark Johnson
            Huong Nguyen Huong Nguyen
            David Woloszyn David Woloszyn
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.