question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] [Node.js] Strange timeout fixed with a simple console.log (weird)

See original GitHub issue

Using :

  • 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:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mamasocommented, Sep 19, 2016

@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.

1reaction
yvelecommented, Sep 26, 2016

PS: I confirm it’s working with 0.6

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found