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

Scope can forget to load system.js procedures if interrupted

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.0-rc2, 4.7.0
    • Affects Version/s: 4.5.1
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Query 2020-04-20, Query 2020-05-04
    • 32

      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

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

              Created:
              Updated:
              Resolved: