{"action":"closed","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/5330","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/5330/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/5330/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/5330/events","html_url":"https://github.com/sequelize/sequelize/issues/5330","id":129531043,"number":5330,"title":"Connection hangs after syncing","user":{"login":"mattecapu","id":5738009,"avatar_url":"https://avatars.githubusercontent.com/u/5738009?v=3","gravatar_id":"","url":"https://api.github.com/users/mattecapu","html_url":"https://github.com/mattecapu","followers_url":"https://api.github.com/users/mattecapu/followers","following_url":"https://api.github.com/users/mattecapu/following{/other_user}","gists_url":"https://api.github.com/users/mattecapu/gists{/gist_id}","starred_url":"https://api.github.com/users/mattecapu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattecapu/subscriptions","organizations_url":"https://api.github.com/users/mattecapu/orgs","repos_url":"https://api.github.com/users/mattecapu/repos","events_url":"https://api.github.com/users/mattecapu/events{/privacy}","received_events_url":"https://api.github.com/users/mattecapu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-28T18:13:23Z","updated_at":"2016-01-29T00:49:52Z","closed_at":"2016-01-29T00:49:52Z","body":"Here's my code\r\n```js\r\nconst ORM = new Sequelize(\r\n    'my_db',\r\n    DB_USER, DB_PASSWORD,\r\n    {\r\n        dialect: 'mysql',\r\n        host: 'localhost',\r\n        port: 3306\r\n    }\r\n);\r\n\r\n/* lots of entities definitions */\r\n\r\nconsole.log('Syncing...');\r\nORM.sync({force: FORCE_SYNC})\r\n    .then(() => console.log('Done!'));\r\n```\r\nWhen I run it, it displays \"Done!\" almost immediatly, but then the process hangs for about 10 seconds, then exits. If I forcefully close the connection from within the Promise handler, it closes immediatly but I'd like not to. My tests showed syncing happens correctly and the handler is called rightfully after sync completion, but then it hangs without any apparent reason.\r\nI found in the code [this comment](https://github.com/sequelize/sequelize/blob/0de404640d4c71e2d1f1259356650dfb586a248b/lib/sequelize.js#L1258) explaining the connection should close automatically at process.exit, so what's going on?"}}