Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-47445

Scope can forget to load system.js procedures if interrupted

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 4.5.1
    • Fix Version/s: 4.4.0-rc2, 4.7.0
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.4
    • Sprint:
      Query 2020-04-20, Query 2020-05-04
    • Linked BF Score:
      32

      Description

      When you tell a Scope instance to load procedures from system.js, it uses a version number to decide whether the contents of system.js are unchanged. When the version number matches, it does nothing; when the version number is different, it does the actual work of loading stored procedures.

      The problem is, the Scope instance updates its version number before doing the work, so if an exception happens during the work, the Scope thinks it's up to date when it's not.

      To fix it we can move this line to the bottom of the function: https://github.com/mongodb/mongo/blob/master/src/mongo/scripting/engine.cpp#L227

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              david.percy David Percy
              Reporter:
              david.percy David Percy
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: