Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-34943

Refactor autosubmit to enclose each update in a separate transaction and notify on failure

    Details

    • 11 status:
      Resolved
    • Property addition/change required:
      Yes
    • Previous Issue Keys:
      SAM-2940
    • Test Plan:
      Hide

      Overview" To properly test this requires database manipulation to set up a scenario that will cause a database exception. The method I use mirrors what happened to us in production, but there could be a simpler method.

      1) a) Turn on the properties : samigo.email.autoSubmit.errorNotification.enabled=true, set the quartz job and run the sql script (see the readme file) , or set a template (if the
      samigo.email.autoSubmit.errorNotification.toAddress=notifyus@example.com
      1b) Also you need to have autosubmit on:
      samigo.autoSubmit.enabled = true
      (and need to add the job to Quartz as admin)
      1c) and set an email address that you can check (or check the catalina.out logs, but this means setting
      testMode@org.sakaiproject.email.api.EmailService=true
      so that email goes to the logs).

      2) First create two quizzes with the same retract dates that send grades to gradebook and are eligible for autosubmit, and attempt them without submitting. Setting "Send assessment score to Gradebook immediately, regardless of options below"

      3) Find the corresponding columns in GB_GRADABLE_OBJECT_T
      Set the external_id on one of them to match the other (now you have two columns for the same quiz)
      Create a third quiz eligible for autosubmit, with the same retract date as the first two, and attempt it without submitting

      4) After the retract date, run the autosubmit job

      Expected result: The first two attempts should fail and you should get an email about it, but the third attempt should be successful

      Prior to this change, all 3 attempts would fail without notice

      Show
      Overview" To properly test this requires database manipulation to set up a scenario that will cause a database exception. The method I use mirrors what happened to us in production, but there could be a simpler method. 1) a) Turn on the properties : samigo.email.autoSubmit.errorNotification.enabled=true, set the quartz job and run the sql script (see the readme file) , or set a template (if the samigo.email.autoSubmit.errorNotification.toAddress=notifyus@example.com 1b) Also you need to have autosubmit on: samigo.autoSubmit.enabled = true (and need to add the job to Quartz as admin) 1c) and set an email address that you can check (or check the catalina.out logs, but this means setting testMode@org.sakaiproject.email.api.EmailService=true so that email goes to the logs). 2) First create two quizzes with the same retract dates that send grades to gradebook and are eligible for autosubmit, and attempt them without submitting. Setting "Send assessment score to Gradebook immediately, regardless of options below" 3) Find the corresponding columns in GB_GRADABLE_OBJECT_T Set the external_id on one of them to match the other (now you have two columns for the same quiz) Create a third quiz eligible for autosubmit, with the same retract date as the first two, and attempt it without submitting 4) After the retract date, run the autosubmit job Expected result: The first two attempts should fail and you should get an email about it, but the third attempt should be successful Prior to this change, all 3 attempts would fail without notice

      Description

      The entire autosubmit loop happens in the same transaction, so any failure during the loop iteration causes all previous work to be rolled back, effectively silently killing the job. To improve this:

      • Each loop iteration gets its own transaction
      • In the event of an iteration failing (an exception is caught), rather than just logging and continuing, note the failure and send an email to a configurable address when the job completes.

      This patch introduces two new sakai.properties:

      samigo.email.autoSubmit.errorNotification.enabled=true
      samigo.email.autoSubmit.errorNotification.toAddress=notifyus@example.com

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  samigoteam SAMIGO TEAM (Inactive)
                  Reporter:
                  plukasew Paul Lukasewych
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code