[SERVER-9294] Running a js script from Windows can cause premature script failure Created: 09/Apr/13  Updated: 23/Apr/13  Resolved: 23/Apr/13

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

Type: Bug Priority: Major - P3
Reporter: Andre de Frere Assignee: Tad Marshall
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 2008 r2


Attachments: File test1.js     File test2.js     File test3.js     File test4.js    
Issue Links:
Duplicate
duplicates SERVER-7319 mongo shell should call getlasterror ... Closed
Related
Operating System: ALL
Steps To Reproduce:

run:

mongo.exe gp test1.js

check the counts of bases2 or fleets collections - there should be 627 documents.

Participants:

 Description   

There seems to be unexpected results when running a js script from Windows. If a script like the attached is run from the shell, not all of the records will be inserted. There will be messages in higher verbosity logs indicating that a connection was forcibly closed:

Tue Apr 09 16:25:01.974 [conn1] insert gp.fleets ninserted:1 keyUpdates:0 locks(micros) w:13 0ms
Tue Apr 09 16:25:01.974 [conn1] insert gp.bases2 ninserted:1 keyUpdates:0 locks(micros) w:13 0ms
Tue Apr 09 16:25:01.989 [conn1] insert gp.fleets ninserted:1 keyUpdates:0 locks(micros) w:44 0ms
Tue Apr 09 16:25:01.989 [conn1] Socket recv() errno:10054 An existing connection was forcibly closed by the remote host. 127.0.0.1:49334
Tue Apr 09 16:25:01.989 [conn1] SocketException: remote: 127.0.0.1:49334 error: 9001 socket exception [1] server [127.0.0.1:49334] 
Tue Apr 09 16:25:01.989 [conn1] end connection 127.0.0.1:49334 (0 connections now open)

But this may not be indicative of the problem.

Some unusual interactions are going on with the script. There will be an output for every item in the script, even if not all of them are inserted. If the print() operation is removed from the rp() function, the inserts will be completed successfully (. test2.js). If a print() command is added to the end of the script, the inserts will be completed successfully (test3.js). If a sleep() (even sleep(0)) is added to the rp() function, the inserts complete successfully (test4.js)

The same test1.js script when run from OSX to a mongod on OSX or Windows will see the inserts complete successfully.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 23/Apr/13 ]

I believe this would be fixed by SERVER-7319

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