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

Mongo client run buffered command when terminated.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 3.4.10
    • Fix Version/s: 3.4.17, 3.6.7, 4.0.1, 4.1.1
    • Component/s: Shell
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.0, v3.6, v3.4
    • Steps To Reproduce:
      Hide

      ## ------------------------
      ## Terminal 1
      ## ------------------------
      $ echo $$
      65551
      $ mongo admin -uuser -p
      MongoDB shell version v3.4.10
      Enter password:
      connecting to: mongodb://127.0.0.1:27017/admin
      MongoDB server version: 3.4.10
       
      shard01:PRIMARY (admin) 17:08:23> use admin
      switched to db admin
      shard01:PRIMARY (admin) 17:08:26> db.test.find()  ==> No documents in this collection
      shard01:PRIMARY (admin) 17:08:33> db.test.insert({text:"not yet executed"})  ==> Not yet execute this command (just typing)
      

      ## ------------------------
      ## Terminal 2
      ## ------------------------
      $ kill -SIGKILL 65551   ==> Kill terminal-1
       
      ## After terminal-1 is killed
      $ mongo admin -uuser -p
      MongoDB shell version v3.4.10
      Enter password:
      connecting to: mongodb://127.0.0.1:27017/admin
      MongoDB server version: 3.4.10
       
      shard01:PRIMARY (admin) 17:09:30> use admin
      switched to db admin
      shard01:PRIMARY (admin) 17:09:31> db.test.find()
      { "_id" : ObjectId("5abb4da6f63b9d80af086edd"), "text" : "not yet executed" }  ==> Document is inserted 
      

      Show
      ## ------------------------ ## Terminal 1 ## ------------------------ $ echo $$ 65551 $ mongo admin -uuser -p MongoDB shell version v3.4.10 Enter password: connecting to: mongodb://127.0.0.1:27017/admin MongoDB server version: 3.4.10   shard01:PRIMARY (admin) 17:08:23> use admin switched to db admin shard01:PRIMARY (admin) 17:08:26> db.test.find() ==> No documents in this collection shard01:PRIMARY (admin) 17:08:33> db.test.insert({text:"not yet executed"}) ==> Not yet execute this command (just typing) ## ------------------------ ## Terminal 2 ## ------------------------ $ kill -SIGKILL 65551 ==> Kill terminal-1   ## After terminal-1 is killed $ mongo admin -uuser -p MongoDB shell version v3.4.10 Enter password: connecting to: mongodb://127.0.0.1:27017/admin MongoDB server version: 3.4.10   shard01:PRIMARY (admin) 17:09:30> use admin switched to db admin shard01:PRIMARY (admin) 17:09:31> db.test.find() { "_id" : ObjectId("5abb4da6f63b9d80af086edd"), "text" : "not yet executed" } ==> Document is inserted
    • Sprint:
      Platforms 2018-07-02

      Description

      When mongo client(mongo shell) is running within linux shell,
      if linux shell is killed or terminated (sigterm), mongo client run buffered command(input command but not yet executed by ENTER/RETURN keyboard) before terminated.

      I don't know this is mongo shell issue or linux terminal.
      But this issue is not happened another CLI client(like mysql client in same scenario).

      This is relatively critical issue what command user typed on mongo client shell.

        Attachments

          Activity

            People

            Assignee:
            jonathan.reams Jonathan Reams
            Reporter:
            matt.lee Matt SeongUck Lee
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: