Code Monkey home page Code Monkey logo

nginx-upstream-dynamic-resolve-servers's People

Contributors

zhaofeng0019 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nginx-upstream-dynamic-resolve-servers's Issues

Crashing when multiple upstream server has resolve param

Imagine this simple configuration:

upstream upstream {
    server example.org resolve;
    server example.com resolve;
    server example.org resolve;
}

When just first upstream contains resolve param, everything works fine. But when multiple upstream servers has resolve param, nginx worker process fail with error in log like this:

socket() failed (97: Address family not supported by protocol) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "https://J?./", host: "localhost"

followed by worker crash. I will try to debug

Questions

Hi,
We're using dynamic_resolve directive from tengine, but are analyzing other options, since that directive resolves DNS in the request path and it should be better to have it asynchronously update, not blocking any request.

I have some questions regarding this module:

  • Why is ssl session resumption disabled, when tengine's directive has it enabled?
  • According to this if dns has just refreshed and a request is being processed the request would be failed, is that correct? Isn't there a high chance of this happening if you have a lot of traffic and DNS refresh quickly (60s)?
  • Is there any way this module is different that tengine's?

Unexpected response

Hi,
Is there any limitation to use this module?
I have tested if there are a lot of domain name use "resolve", the server will return "(52) Empty reply from server" or "(35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to xxx" in many requests.

dynamic_server may be NULL

ngx_int_t ngx_http_upstream_dynamic_resolve_directive(
    ngx_conf_t *cf, ngx_http_upstream_server_t *us, ngx_uint_t *i)
{
    // ...
    ngx_http_upstream_dynamic_resolve_server_conf_t *dynamic_server = NULL;
    // ...
    ngx_parse_url(cf->pool, &u);
    if (!u.addrs || !u.addrs[0].sockaddr)
    {
        *// If it doesn't run here
        dynamic_server = ngx_array_push(&udrsmcf->dynamic_servers);
        if (dynamic_server == NULL)
        {
            return NGX_ERROR;
        }
        ngx_memzero(dynamic_server,
                    sizeof(ngx_http_upstream_dynamic_resolve_server_conf_t));
        // ...
    }

    // ...
    dynamic_server->use_last = 1;    *// dynamic_server may be NULL
    return NGX_AGAIN;
}

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.