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.

ETIMEDOUT and ECONNRESET errors, might be because very short polling intervals

See original GitHub issue

Using node 0.12.5 and Azure SDK version 0.10.6.

Here’s a part of my code:

AzureServiceBus.prototype.onMessage = function(callback) {
    var self = this;

    if (this.isSubscribed) {
        setInterval(function() {
            self.connectionClient.receiveSubscriptionMessage(self.subscription, self.name, function(err, serverMessage) {
                if (err && err == 'No messages to receive') {
                    return ;
                } else if (err) {
                    console.log('Error'.red+' receiving Subscription Message from Azure ServiceBus');
                    console.log(err);
                } else {
                    callback(serverMessage.body);
                }
            });
        }, this.config.polling_interval < 50 ? 50 : this.config.polling_interval);
    }
};

I come from a kafka developer background where I didn’t need to use polling to get new messages.

I usually get ECONNRESET error messages coming from that callback when the topic is active (receiving/writing messages). It doesn’t happen at the same place in my code (I have unit tests which fail in different points).

Sometimes I get ETIMEDOUT when first booting up my worker (it settles down after 3-5 errors like this).

Am I doing the setInterval thingy wrong ? If I increase the interval to 100 it doesn’t Error anymore but after a while some messages arrive delayed (the framework I’m working on must be real time, and I’m not willing to increase it further than 100).

Any other opinions on this ? Maybe Service Bus topics aren’t a good fit for this scenario at all.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Mayhem93commented, Oct 1, 2015

Thanks for the quick reply. { timeoutIntervalInS: 30 } Helps but it doesn’t resolve the issue completely: I get ECONNRESET much less often (usually after I run my unit tests, like 3-5 of them).

And another issue: memory usage is waaay too high: I have 5 workers and 1 API (on the same machine). When using Kafka as the messaging client I get around ~950 MB of total RAM usage. When using Azure I get around 2250 of total RAM usage (it doesn’t start at 2250, but it increases in a matter of seconds then stabilizes at that value). The machine’s RAM usage without any of these running is @ around 150 MB.

I don’t see any possible memory leakage from my code.

0reactions
tony-gutierrezcommented, Feb 8, 2018

If you are using timeoutIntervalInS, is there any need to do your own interval? Or would you just run one request right after the last one completes? There is no docs on timeoutIntervalInS anywhere…what does it do??? Receive messages for x seconds, or just an abort timeout or what??

Read more comments on GitHub >

github_iconTop Results From Across the Web

A brand new website interface for an even better experience!
ETIMEDOUT and ECONNRESET errors, might be because very short polling intervals.
Read more >
Sometime Meet Etimedout And Econnreset - ADocLib
If you can connect to the internet without using your proxy, ... ETIMEDOUT and ECONNRESET errors, might be because very short polling intervals...
Read more >
Amazon SQS short and long polling
Learn about the benefits of using Amazon SQS long polling to eliminate empty responses and false empty responses and to reduce your costs....
Read more >
How to handle a socket hang up error in Node.js usually - Quora
Socket hang up error are usually errors when requests coming to your server are more than it can handle. This might be b...
Read more >
DIGITAL TCP/IP Services for OpenVMS
struct sockaddr_in { short sin_family;(1) /* address family */ u_short sin_port ... Use the errno value to obtain a more detailed description of...
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