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

Set web service used by bulk messaging to use read-only sessions

    XMLWordPrintable

Details

    • MOODLE_402_STABLE
    • MOODLE_404_STABLE
    • MDL-79619_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 and enrol a few students
      4. Go to the Participants page
      5. Check "Select all" checkbox in the heading of the list of participants
      6. From the "With selected users..." menu, select "Send a message"
      7. Enter a message and click "Send message to X people"
        • Confirm that the message is sent
        • 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 and enrol a few students Go to the Participants page Check "Select all" checkbox in the heading of the list of participants From the "With selected users..." menu, select "Send a message" Enter a message and click "Send message to X people" Confirm that the message is sent 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".

    Description

      During performance testing on a large site, I found that web service calls to core_message_send_instant_messages were holding long session locks. While calls were not very common, and only a small proportion of locks in my analysis, they had a high median lock time of about 7 seconds.

      I tested setting 'readonlysession' => true in the web service defintion and $CFG->enable_read_only_sessions_debug = true, and was able to send bulk messages using this web service without generating any errors.

      I propose adding 'readonlysession' => true to this web service in lib/db/services.php

      Attachments

        Activity

          People

            marxjohnson Mark Johnson
            marxjohnson Mark Johnson
            Marcus Green Marcus Green
            Huong Nguyen Huong Nguyen
            David Woloszyn David Woloszyn
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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

                Clockify

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