[SERVER-4263] call getLastError before exiting after executing command-line script Created: 11/Nov/11  Updated: 05/Apr/17  Resolved: 27/Jan/17

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Daniel Pasette (Inactive) Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 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.



 Comments   
Comment by Mira Carey [ 27/Jan/17 ]

Now that we do acknowledged writes, I don't believe this situation exists anymore.

Generated at Thu Feb 08 03:05:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.