Skip to content

Port the multi connection fixes from #24 to the older nginx patches #25

Open

Description

@shreemaan-abhishek

#24 fixed these in nginx-1.31.8.patch, the patch apisix-runtime ships. The older nginx-*.patch files (1.19.3 to 1.31.1) still have the old code in the patched ngx_http_upstream_connect():

  1. A new connection that connects immediately (e.g. a unix socket upstream) is taken for a reused one and the request fails with 500.
  2. A request that lands on a reused connection that is still connecting fails with 500 instead of waiting for the connect.
  3. All three error branches log through c->log after finalizing, and finalizing can free the pool that owns it.

The fix for each is the ngx_http_upstream_connect() hunk of nginx-1.31.8.patch from #24. The pc->cached = 0 change in ngx_http_multi_upstream_get_peer() that it relies on is in the module source, so it already applies to every version.

These only matter for builds that combine an older OpenResty with a module release that includes #24. api7ee-runtime pins 1.1.1.

Activity

  1. changed the title [-]bug: immediately connected new multi connection fails with 500[/-] [+]Port the multi connection fixes from #24 to the older nginx patches[/+] on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions