GithubHelp home page GithubHelp logo

Comments (8)

bendrucker avatar bendrucker commented on July 19, 2024

It would be helpful to see how you're orchestrating these calls (also syntax highlight code with GitHub Flavored Markdown please).

from needle.

 avatar commented on July 19, 2024

Hi. I have updated my original post. On the first POST I get the 1st document and on the second POST the 2nd associated document.

from needle.

tomas avatar tomas commented on July 19, 2024

Can you post the full stacktrace of your error?

from needle.

 avatar commented on July 19, 2024

Hello. I added the console.trace.

from needle.

bendrucker avatar bendrucker commented on July 19, 2024

Is it possible there's a race condition at work and you're actually running up against the per-host maxSockets limit of 5? Are you handling errors and determining success using populateList? Also note that your code as it stands could be more succinctly rewritten as:

needle.post(URL, DATA, populateList);

from needle.

 avatar commented on July 19, 2024

Hi. As you said I am determining success using populateList. As for the maxSockets, I have no idea. Do you know how I can check that on a RedHat server?

For the part about needle.post(URL, DATA, populateList);, I did it intentionally so I won't pass the response on the parameter but a different parameter. I changed it as you proposed but unfortunately it does not make any difference.

from needle.

bendrucker avatar bendrucker commented on July 19, 2024

It's not a server property. It's something the Node agent proposes but you can override. See the node docs link above.

Re: referencing functions vs. passing the literal in directly, the idea is that they're exactly identical. Just saves you a little verbosity.

I'd consider the way you're aggregate results to be an anti-pattern. You should be using some sort of async pattern to handle that logic (i.e. the aggregate operation should fail if a single member fails). I like promises. They're a more robust abstraction but also require some effort to properly understand. You can also try async for something simpler.

Try running all 10 operations in sequence so only one socket is open at any given time. Based on the stack trace this almost certainly isn't a needle issue.

from needle.

 avatar commented on July 19, 2024

Unfortunately it will take me some time to rewrite that part so instead I am going to use elasticsearch.js in order to make the calls. Already tried it and it works as expected.

Thank you for the help guys.

from needle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.