Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket hangup when forcing restify client to retry ad infinitum #122

Open
zyrolasting opened this issue May 15, 2017 · 3 comments
Open

Socket hangup when forcing restify client to retry ad infinitum #122

zyrolasting opened this issue May 15, 2017 · 3 comments

Comments

@zyrolasting
Copy link

zyrolasting commented May 15, 2017

This is a cross-post from my question on SO. I suspect this is a configuration mistake on my end, and would appreciate any help understanding where that mistake lies.


I am running several Restify v4.2.0 services in separate processes. One of them is special because it needs to be up and listening before all of the others even start.

Assume that I cannot use IPC, and all services must talk to the special service via HTTP. This leaves me with HTTP clients that attempt to contact the special service ad infinitum, waiting until it is up.

Hence this client with intentionally extreme options.

const client = restify.createStringClient({
    url,
    retry: {
        retries: Infinity,
    },
});

// Inside a promise
client.get(endpoint, function(err, req, res, data) {
    if (err) {
        reject(err);
    } else {        
        // ...

        // Probably not needed for GET, but here anyway.
        req.end();
        resolve(data);
    }
});

No matter how I configure the client, I still immediately get socket hang up errors. I want the nodeback to never fire until it finally reaches the service.

What do I need to do to my configuration to accomplish this?

@zyrolasting
Copy link
Author

zyrolasting commented May 15, 2017

@retrohacker Possibly related to restify/node-restify#483

@retrohacker
Copy link
Member

Hey @zyrolasting!

Sorry for the radio silence on this issue. restify/clients is currently a bit outside of my wheelhouse (I'm still getting up to speed on the main repo). It might be a while before I am in a position to fully grok the codebase in the client repo but will follow up here when I get to that point ❤️

In the meantime, restify/clients can definitely use some love if you are interested in helping out. Would be happy to work through this together at some point.

@zyrolasting
Copy link
Author

@retrohacker I can make time to work on this issue and poke around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants