Skip to content

Releases

v0.5.2

Choose a tag to compare

@joneum joneum released this 27 Nov 05:32

Fixed

  • An SSL check no longer leaks its SSL object, 81 KB at a time. Three
    places close a check connection, and only one of them shut the SSL side
    down first; the one that runs when the worker is told to go did not,
    so a check that was in flight at that moment left the object behind.
    The shutdown also asked for a graceful close, which can return
    NGX_AGAIN and leave the object for a connection that is closed in the
    next line anyway. All three now go through one place that takes the
    quiet path, which frees the object there and then.

  • CI: the Test::Nginx cache is now keyed by the Perl build, not just by
    the runner OS. When the hosted image moved to Ubuntu 26.04 the cached
    ~/perl5 tree was restored against a new interpreter and every test
    file died before its first assertion with loadable library and perl binaries are mismatched, taking Build & Test, A/UBSan and Valgrind
    down together.

  • CI: the sanitizer run can see what it is for now. ngx_palloc hands
    out slices of a pool block, so a write past an allocation landed inside
    memory ASan had handed over whole and no report was made; nginx keeps a
    switch for exactly this and NGX_DEBUG_PALLOC sends every allocation
    straight to malloc. The reports were being lost as well, because nginx
    redirects its own stderr onto the error log file as soon as error_log
    names one, so both sanitizers write to files of their own now and the
    findings step runs even after a failed suite, which is precisely what a
    worker that ASan took down leaves behind.

v0.5.1

Choose a tag to compare

@joneum joneum released this 15 Nov 18:12

freenginx support: the module did not build there at all, and it
needs its own nginx patch.

Fixed

  • The module did not build against freenginx at all. ngx_http_status_t
    carries a count member in nginx and none in freenginx, and four
    places here used it while parsing a status code digit by digit. The
    counter now lives in this module's own context, which is where it
    belonged anyway: the status line parser is handed whatever has arrived
    and called again for the rest, so the count has to survive between
    calls. No preprocessor branch is needed, and both servers take the
    same code.

    The FreeBSD port had been patching around this with a local variable,
    which starts at zero on every call and so miscounts a status code that
    arrives split across two reads. That patch is no longer needed.

Added

  • patches/freenginx-1.30+.patch. freenginx branched before
    NGX_HTTP_UPSTREAM_SID and ngx_md5.h reached nginx's round robin, so
    the nginx patch does not apply there: seven of its ten hunks are
    refused. The hooks are the same, their surroundings are not. Verified
    to apply without offset to freenginx 1.30.2, and the server built and
    ran with it.

v0.5.0

Choose a tag to compare

@joneum joneum released this 15 Nov 17:57

Three real defects out of eighty-eight open reports, four features the
rest of them asked for, and one nginx patch in place of eighteen.

Every fix is gated, and every gate was shown to fail against the old
behaviour before it was kept.

Fixed

  • A type=tcp check ran once per worker and then stopped for good. The
    tcp type carried need_keepalive, but a tcp check only connects and
    peeks, so it never sends a request and c->requests stays at zero. The
    ceiling in clean_event (c->requests < check_keepalive_requests,
    default 1) was therefore never reached, the connection was never closed,
    and begin_handler returned early on pc.connection at every later
    tick. The visible signature: rise froze at exactly the number of
    workers, and because an unchecked peer still reads up, a backend that
    died afterwards was never taken out. The tcp type no longer asks for
    keepalive, which is what it always meant: connect afresh each interval.
    Measured before and after on a four worker server, rise 4-4-4-4
    against 5-13-23-33, with failure and recovery both seen again.
    ci/tcpcheck.sh is the gate, and it was shown to fail against the old
    behaviour before it was kept.
    (upstream issues #143, #144, #202, #232, #233, #268, #275, #285;
    upstream pull requests #282, #287)

  • The same kept connection held one descriptor per peer and per worker for
    the life of the process. Closing it after each check ends that.
    (upstream issues #235, #267)

  • Every per peer pool, and every open check connection, was left behind
    when a process was told to shut down between two ticks. Releasing them
    is clear_all_events, and the only path into it was need_exit, which
    only the check handlers call; the module's exit process slot was null.
    So the cleanup ran if a check happened to be in flight at the wrong
    moment, and otherwise did not. The module answers shutdown now instead
    of hoping for it. Measured under valgrind: one 4096 byte pool per peer
    whose check type needs one, gone afterwards, with nothing of this
    module left in any trace.
    (upstream issue #235)

  • Nothing worked under master_process off. init_process returned
    early for anything that was not NGX_PROCESS_WORKER, and a server
    running without a master is NGX_PROCESS_SINGLE. No timer was ever
    added, so no check ran; worse, add_timers is also where peer->shm
    is bound, so every peer kept a null shm and the status page walked into
    it. Single process mode is now treated as what it is, a worker that
    happens to be alone. This is also why there was no Test::Nginx suite
    to inherit: Test::Nginx runs the server exactly that way, so every
    block would have failed.
    (upstream issues #147, #225)

Added

  • check_status prometheus, and ?format=prometheus, serving the
    exposition format with the content type a scraper expects: the peer
    state and the two counters the checker decides on as gauges, plus the
    shared memory generation. Every series of a metric sits under one HELP
    and one TYPE line, which is what makes it a format rather than a page
    with numbers on it.
    (upstream issue #190, upstream pull request #209)

  • check ... type=https: a real TLS handshake through nginx's own
    ngx_ssl_*, and then exactly the http check through the connection
    it hands back. The module had nothing of the sort: ssl_hello writes
    a client hello onto a plain connection by hand and looks for a server
    hello in the reply, which says something at the other end speaks TLS,
    not that it serves. The certificate is deliberately not verified, for
    the reason given in the README; the connection is never kept, so every
    check is its own handshake. Only built where nginx has
    --with-http_ssl_module.
    (upstream issue #253, upstream pull requests #281, #283)

  • check ... type=udp: the payload goes out as a datagram and any reply
    counts as alive. nginx's own connect makes the socket, so it is
    connected and the kernel reports an ICMP unreachable from a closed port
    back to us as an error rather than dropping it. What a reply means is
    not something this check can judge, and it does not pretend to.
    (upstream issue #159)

  • check_http_expect_body, which takes a peer out when the response body
    does not contain what it should, however fine the status code was. An
    application that has lost its database usually still returns 200 from
    the front of the stack. The match is a plain substring and is looked
    for after the end of the headers, so a match in a header does not
    count; until the headers and then the text have arrived the check says
    "not yet", and a peer that closes or times out first fails, which is
    what a body that never says what it should ought to do.
    (upstream pull request #220)

Changed

  • The nginx hooks are one patch, patches/nginx-1.30+.patch, covering the
    1.30 and 1.31 lines; upstream carried eighteen version specific patches
    that stopped at much older releases. Verified to apply cleanly to
    nginx 1.30.6 and 1.31.8.
  • The module sources moved to src/, as in every other repository here.

Verified

  • Builds against nginx 1.30.6 and 1.31.8 on Linux with gcc 11.5, under
    nginx's own -Werror, without a warning from this module.

  • Every balancer honours the check, which four open reports doubted:
    round robin, hash, hash ... consistent, ip_hash and least_conn.
    ci/balancers.sh stops a backend each one actually uses and then
    requires that every request still succeeds and that none is answered by
    the one that is gone, with proxy_next_upstream off so that a retry
    cannot cover for a balancer that ignored the state. Nothing had to be
    changed for this; the gate is what keeps it true. It discriminates:
    with the hook taken out of ngx_http_upstream_get_hash_peer it reports
    hash and nothing else, with it taken out of get_chash_peer it
    reports hash-consistent and nothing else.
    (upstream issues #210, #221, and by extension #152, #183)

  • Reloading with a failing backend leaves the master alone. Eight
    reloads in a row against a backend that never answers: every one
    absorbed, the module still answering afterwards, the master's
    descriptor count unmoved, no worker dead by signal. ci/reload.sh
    with a deliberately unreachable peer in ci/reload.conf.
    (upstream issue #194)

Not reproduced

  • #211 reports a SIGSEGV after a few minutes on nginx 1.14.2 with the
    version specific patch of the day, with no configuration, no trace and
    no way to repeat it. It is not dismissed, it is simply not actionable
    as written; the sanitizer, valgrind, reload and balancer gates now
    cover the ground it would have come from.