Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-2773

Add way to manually flush buffer for mongoimport

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Accepted
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mongoimport
    • Labels:
      None

      Description

      When mongoimport reads from stdin, SIGINT (^C) terminates without flushing any outstanding data in the write buffer. So the user must do one of these to gracefully shut down and flush the buffer:

      • Indicate an EOF (^D) to the terminal
      • Manually close the pipe / file descriptor that's associated with stdin
      • Use a command structure that automatically closes the pipe (e.g. cat out.json | mongoimport ...)

      If mongoimport is run in the background as a daemon, the user doesn't have many good ways to manually flush the buffer from a scripting standpoint.

      We can consider trapping SIGUSR1 to flush the buffer before passing control to the SIGINT logic. We can also potentially flush when we see SIGINT, but that might require a bit of investigation on whether that'll affect UX.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              evgeni.dobranov Evgeni Dobranov
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: