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.

Does not support concurrent requests

See original GitHub issue

I am writing a node app that caches data from several different sharepoint collections, but problems occur when you perform simultaneous requests (I have each data endpoint caching concurrently). It seems as though the last request overrides any requests that have not yet completed. All requests will complete and call their callback function, but each callback contains the data from the last request made.

When running each request after the previous has returned, the issue does not arise, it is only when there are multiple requests made at a time.

var request = require('node-http-ntlm');
var urls = [
    'url1', //Returns 'data1'
    'ur2', //Returns 'data2'
    'url3' //Returns 'data3'
];
var opt, i;
for(i in urls){
    opt = {
        url: urls[i],
        //..credentials
    }
    request.get(opt, function(err, res){
        if(err){
            console.info(err);
        }else{
            console.info(res);
        }
    });
}

Should print (in no particular order, depending on which requests return first):

data1
data2
data3

actual output is

data3
data3
data3

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
larneracommented, May 4, 2016

Sorry @SamDecrock, any thoughts on the above?

0reactions
SamDecrockcommented, Mar 13, 2017

I’m using setImmediate() in my code. This means that requests can be interrupted by other events. I suppose the server can’t handle 3 concurrent authentications from the same client.

I suppose you don’t really want to authenticate 3 times. Can’t you authenticate once and the use the received cookies to stay in the session.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebClient does not support concurrent I/O operations
The WebClient only supports a single operations, it cannot download multiple files. You haven't shown your code, but my guess is that you...
Read more >
WebClient does not support concurrent I/O operations - MSDN
I have some code, that fires async calls multiple times, but I only do this from the DownloadStringCompletedEvent.
Read more >
Handling Concurrent Requests in a RESTful API - Medium
The problem is very simple: users A and B requested a resource more or less at the same time, and got the same...
Read more >
STPPaymentHandler does not support concurrent calls to its ...
We have a user that is unable to complete a payment. After completing the 3d secure flow the user receives the following error...
Read more >
What to Do When Concurrent Requests Are Not Processing ...
Oracle Concurrent Processing - Version 11.5.10.2 to 12.2.7 [Release 11.5 to 12.2]: Concurrent Processing: What to Do When Concurrent ...
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