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

call getLastError before exiting after executing command-line script

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Shell
    • Fully Compatible

    Description

      In testing, with vvvvv logging, a user noticed these in their log:

      Wed Nov  9 13:45:26 [conn4] insert test.in1 0ms
      Wed Nov  9 13:45:26 [conn4] Socket recv() conn closed? 127.0.0.1:33555
      Wed Nov  9 13:45:26 [conn4] SocketException: remote: 127.0.0.1:33555
      error: 9001 socket exception [0] server [127.0.0.1:33555]
      Wed Nov  9 13:45:26 [conn4] end connection 127.0.0.1:33555
      Wed Nov  9 13:45:26 [conn6] insert test.in1 0ms

      This was generated with a short script that just inserts documents in a loop:

      db = db.getSiblingDB('techjam');
       
      for(i = 0; i < 100000; ++i) {
          db.tc.save({a:i});
      }

      If you load() the script from inside the shell, you don't get the broken sockets. But if you run the script by specifying it on the command line, then the shell exits so fast that the server gets the error message above. We should add a final getLastError() before exiting the shell in this mode so that we don't get these, because the tester believed they were being disconnected and data was being dropped on the floor, even though it wasn't.

      Attachments

        Activity

          People

            backlog-server-platform DO NOT USE - Backlog - Platform Team
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: