Skip to content

Server doesn't shut down with Ctrl+C #2875

Closed
@kulshekhar

Description

@kulshekhar

When using parse server with the Postgres database adapter, the server doesn't shut down when CTRL+C is pressed.

Steps to reproduce

  1. Start parse server:

    parse-server --appId a --masterKey m --databaseURI postgres://username:password@localhost:5432/db-name
    
  2. Start parse dashboard and point it to this

    parse-dashboard --appId a --masterKey m --serverURL http://localhost:1337/parse
    
  3. Open the parse dashboard in a browser (http://localhost:4040/apps)

  4. Stop parse dashboard (this step isn't necessary)

  5. Try to stop parse server by pressing CTRL+C in the terminal where it was started.

Expected Results

Parse server stops

Actual Outcome

The following message is displayed and the server hangs:

Termination signal received. Shutting down.

If CTRL+C is pressed repeatedly (about 10-12 times), the following message is displayed:

(node:32165) Warning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit

Note that if parse dashboard isn't used, CTRL+C works as expected and parse server shuts down.

Environment Setup

  • Server
    • parse-server version : commit de36d96 on master
    • Operating System: Linux Mint 17.3
    • Hardware: amd64
    • Localhost or remote server? localhost

Note: this issue is also present when using the release 2.2.22. However, with this release, some code has to be modified to use the Postgres adapter.

  • Database
    • Postgres version: 9.5/9.6
    • MongoDB: 3.2.10
    • Hardware: linux amd64
    • Localhost or remote server? localhost

Logs/Trace

appId: a
masterKey: ***REDACTED***
port: 1337
databaseURI: postgres://username:password@localhost:5432/parse-test
mountPath: /parse
maxUploadSize: 20mb
verbose: 1
serverURL: http://localhost:1337/parse

[32517] parse-server running on http://localhost:1337/parse
verbose: REQUEST for [GET] /parse/serverInfo: {} method=GET, url=/parse/serverInfo, host=localhost:1337, connection=keep-alive, content-length=140, origin=http://localhost:4040, user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36, content-type=text/plain, accept=*/*, referer=http://localhost:4040/apps, accept-encoding=gzip, deflate, br, accept-language=en-US,en;q=0.8, 
verbose: RESPONSE from [GET] /parse/serverInfo: {
  "response": {
    "features": {
      "globalConfig": {
        "create": true,
        "read": true,
        "update": true,
        "delete": true
      },
      "hooks": {
        "create": false,
        "read": false,
        "update": false,
        "delete": false
      },
      "cloudCode": {
        "jobs": true
      },
      "logs": {
        "level": true,
        "size": true,
        "order": true,
        "until": true,
        "from": true
      },
      "push": {
        "immediatePush": true,
        "scheduledPush": false,
        "storedPushData": true,
        "pushAudiences": false
      },
      "schemas": {
        "addField": true,
        "removeField": true,
        "addClass": true,
        "removeClass": true,
        "clearAllDataFromClass": true,
        "exportClass": false,
        "editClassLevelPermissions": true,
        "editPointerPermissions": true
      }
    },
    "parseServerVersion": "2.2.22"
  }
} create=true, read=true, update=true, delete=true, create=false, read=false, update=false, delete=false, jobs=true, level=true, size=true, order=true, until=true, from=true, immediatePush=true, scheduledPush=false, storedPushData=true, pushAudiences=false, addField=true, removeField=true, addClass=true, removeClass=true, clearAllDataFromClass=true, exportClass=false, editClassLevelPermissions=true, editPointerPermissions=true, parseServerVersion=2.2.22
verbose: REQUEST for [GET] /parse/classes/_Installation: {
  "where": {},
  "limit": 0,
  "count": 1
} method=GET, url=/parse/classes/_Installation, host=localhost:1337, connection=keep-alive, content-length=171, origin=http://localhost:4040, user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36, content-type=text/plain, accept=*/*, referer=http://localhost:4040/apps, accept-encoding=gzip, deflate, br, accept-language=en-US,en;q=0.8, , limit=0, count=1
verbose: REQUEST for [GET] /parse/classes/_User: {
  "where": {},
  "limit": 0,
  "count": 1
} method=GET, url=/parse/classes/_User, host=localhost:1337, connection=keep-alive, content-length=171, origin=http://localhost:4040, user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36, content-type=text/plain, accept=*/*, referer=http://localhost:4040/apps, accept-encoding=gzip, deflate, br, accept-language=en-US,en;q=0.8, , limit=0, count=1
verbose: RESPONSE from [GET] /parse/classes/_Installation: {
  "response": {
    "results": [],
    "count": 0
  }
} results=[], count=0
verbose: RESPONSE from [GET] /parse/classes/_User: {
  "response": {
    "results": [],
    "count": 0
  }
} results=[], count=0
^CTermination signal received. Shutting down.
^CTermination signal received. Shutting down.
^CTermination signal received. Shutting down.
^CTermination signal received. Shutting down.
^CTermination signal received. Shutting down.
^CTermination signal received. Shutting down.
^CTermination signal received. Shutting down.
^CTermination signal received. Shutting down.
^CTermination signal received. Shutting down.
^CTermination signal received. Shutting down.
^CTermination signal received. Shutting down.
(node:32517) Warning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit
^CTermination signal received. Shutting down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions