title: ETIMEDOUT during sequelize.sync()
body: <p>So about 60% of the time when I start up the server, I get this error.</p>
  
  <pre><code>[2014-10-31T00:55:30.763Z] ERROR: main/4588 on vagrant-centos65.vagrantup.com: undefined (err.errorno=ETIMEDOUT, err.code=ETIMEDOUT, err.syscall=connect, err.fatal=true)
  Error: connect ETIMEDOUT
      at Connection._handleConnectTimeout (/vagrant/node_modules/mysql/lib/Connection.js:346:13)
      at Socket.g (events.js:180:16)
      at Socket.emit (events.js:92:17)
      at Socket._onTimeout (net.js:326:8)
      at Timer.unrefTimeout [as ontimeout] (timers.js:427:13)
      at Protocol._enqueue (/vagrant/node_modules/mysql/lib/protocol/Protocol.js:135:48)
      at Protocol.handshake (/vagrant/node_modules/mysql/lib/protocol/Protocol.js:52:41)
      at Connection.connect (/vagrant/node_modules/mysql/lib/Connection.js:109:18)
      at /vagrant/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:41:16
      at sequelizeResolver (/vagrant/node_modules/sequelize/lib/promise.js:32:12)
      at new Promise (/vagrant/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:82:37)
      at new SequelizePromise (/vagrant/node_modules/sequelize/lib/promise.js:28:17)
      at ConnectionManager.connect (/vagrant/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:23:10)
  From previous event:
      at new Promise (/vagrant/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:82:37)
      at new SequelizePromise (/vagrant/node_modules/sequelize/lib/promise.js:28:17)
      at ConnectionManager.connect (/vagrant/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:23:10)
      at ConnectionManager.$connect (/vagrant/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:200:41)
      at Object.pool.Pooling.Pool.create (/vagrant/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:163:14)
      at createResource (/vagrant/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:261:13)
      at dispense (/vagrant/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:253:9)
      at Object.me.acquire (/vagrant/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:319:5)
  From previous event:
      at new Promise (/vagrant/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:82:37)
      at new SequelizePromise (/vagrant/node_modules/sequelize/lib/promise.js:28:17)
      at ConnectionManager.getConnection (/vagrant/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:183:10)
      at module.exports.Sequelize.query (/vagrant/node_modules/sequelize/lib/sequelize.js:590:85)
      at module.exports.QueryInterface.createTable (/vagrant/node_modules/sequelize/lib/query-interface.js:151:29)
      at /vagrant/node_modules/sequelize/lib/model.js:413:34
  From previous event:
      at module.exports.Model.sync (/vagrant/node_modules/sequelize/lib/model.js:408:20)
      at /vagrant/node_modules/sequelize/lib/sequelize.js:730:20
  Possibly unhandled Error: undefined
      at Promise._settlePromiseAt (/vagrant/node_modules/sequelize/lib/promise.js:66:18)
  From previous event:
      at module.exports.Sequelize.sync (/vagrant/node_modules/sequelize/lib/sequelize.js:713:22)
      at Object.&lt;anonymous&gt; (/vagrant/server.js:111:3)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
      at Function.Module.runMain (module.js:497:10)
      at startup (node.js:119:16)
  </code></pre>
  
  <p>The other 40% of the time it goes through no problem. This only started happening when I switched to OS X, but it's all running in vagrant so it shouldn't matter. Any ideas?</p>
  
  <p><strong>Edit:</strong>
  So I've narrowed down what the problem is. I'm able to reproduce the error if I busy wait for ~10 seconds anywhere in the code (even at the beginning!), e.g.</p>
  
  <pre><code>'use strict';
  for (var i = 0; i &lt; 1e10; i+=2){}
  var express = require(...
  </code></pre>
  
  <p>So it seems that taking too long to call sequelize.sync() will cause this error. But why?</p>