[Bug] [Node.js] Strange timeout fixed with a simple console.log (weird)
See original GitHub issueUsing :
- Azure Function : ~0.4 (and ~0.5)
- Node.js : 5.9.1 (and 6.4.0)
I’ve been using Azure Function with Node.js without any problem. Then I decided to transpil my code with Babel.js to make use of await/async. A strange bug appeared… an Azure Function timeout. I tried many things and after only adding logging, the timeout disappeared…
Here is the transpiled code with the console.log
line… If I remove this single line, my Azure Function will timeout.
Index.js
"use strict";
module.exports = require("./lib/handle");
lib/handle.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = handle;
var _EndPoint = require("./EndPoint");
var _EndPoint2 = _interopRequireDefault(_EndPoint);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// endPoint may be reused for many requests
const endPoint = new _EndPoint2.default();
/**
* Basic Azure Function handle
*
* @param {Object} context Context object
* @param {Object} req Request object
*/
function handle() {
/* eslint no-console: 1 */
// TODO: Next line is a hack to avoid timeout on Azure
console.log("Starting...");
endPoint.handle(...arguments);
}
module.exports = exports["default"];
Microsoft Support : I can give you my Azure Function URL in private
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Timeout error when calling external API from node.js
It usually has timeout issue if url does not exist or maybe their servers are temporarily down. Also I would recommend using axios....
Read more >Top 10 Most Common Node.js Developer Mistakes
Often, reasons for such criticisms are rooted in how developers use/misuse the language. This article explores ten common mistakes that Node.js developers ...
Read more >The 10 Most Common JavaScript Issues Developers Face
If you need help figuring out why your JavaScript isn't working, consult this list of the 10 most common JavaScript issues from a...
Read more >A Complete Guide to Timeouts in Node.js
Assigning timeout values prevents network operations in Node.js from blocking indefinitely. This article provides extensive instruction on ...
Read more >TLS (SSL) | Node.js v20.5.1 Documentation
When using CommonJS, the error thrown can be caught using try/catch: ... The timeout can be configured with the sessionTimeout option of tls....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yvele @mathewc I ran a scenario with the
_asyncToGenerator(fn)
and it works after adding the #664 fix. Without #664 we encounter the hang. This should be working in release 0.6.PS: I confirm it’s working with 0.6