title: handshake inactivity TimeOut error in aws lambda and Rds
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var mysql = require('mysql');
  var config = require('./config.json');
  
  var pool  = mysql.createPool({
      host     : config.dbhost,
      user     : config.dbuser,
      password : config.dbpassword,
      database : config.dbname
    });
  
    module.exports.handler = (event, context, callback) =&gt; {
      //prevent timeout from waiting event loop
      context.callbackWaitsForEmptyEventLoop = false;
      pool.getConnection(function(err, connection) {
        // Use the connection
        if(err){
          return callback(err,null);
        }
        connection.query("Select * from allBlogs", function (error, results, fields) {
          connection.release();
          // Handle error after the release.
          console.log(results);
          var len = results.length;
          var i = 0;
          for(i ; i &lt; len; i++) {
            var tagArray = results[i].tag.split(",");
            results[i].tag = tagArray;
            tagArray = [];
          };
          if (error) {callback( {statusCode: 400, headers: { "Access-Control-Allow-Origin": "*" }, body: JSON.stringify(error)} ,null)}
          else {
          callback(null, { statusCode: 200, headers: { "Access-Control-Allow-Origin": "*" }, body: JSON.stringify(results) });
          }
          });
      });
    };</code></pre>
  </div>
  </div>
  </p>
  <p>i am using Aws lambda ,API gateway and RDS database but i am facing a handshake inactivity error .below is the my code which is written in node.js</p>