Skip to content

update lua-resty-healthcheck to version 2.2.0 .#1417

Merged
membphis merged 1 commit into
apache:masterfrom
membphis:new-healthcheck
Apr 8, 2020
Merged

update lua-resty-healthcheck to version 2.2.0 .#1417
membphis merged 1 commit into
apache:masterfrom
membphis:new-healthcheck

Conversation

@membphis membphis added the bug Something isn't working label Apr 8, 2020
@membphis
membphis merged commit 4a50ad4 into apache:master Apr 8, 2020
@membphis
membphis deleted the new-healthcheck branch April 8, 2020 07:52
SaberMaster pushed a commit to SaberMaster/incubator-apisix that referenced this pull request Jun 30, 2020
shreemaan-abhishek added a commit to shreemaan-abhishek/apisix that referenced this pull request Apr 30, 2026
Cover the four scenarios the fix addresses end-to-end via stream
sockets: service status disable, re-enable, deletion, and recreation.
Each asserts that route matching reflects the new service state once
the rebuild path runs.

Ports the test file from api7-ee apache#1417 (the source PR for this
backport) which was omitted from the initial port.
shreemaan-abhishek added a commit that referenced this pull request May 7, 2026
* fix: rebuild stream router when services change

* test: add integration tests for stream router rebuild on service change

Cover the four scenarios the fix addresses end-to-end via stream
sockets: service status disable, re-enable, deletion, and recreation.
Each asserts that route matching reflects the new service state once
the rebuild path runs.

Ports the test file from api7-ee #1417 (the source PR for this
backport) which was omitted from the initial port.

* fix: skip stream routes whose service is missing or disabled

The previous commit started rebuilding the stream router whenever
services.conf_version changes, but the rebuild produced the same
routing decisions because create_router() didn't actually consult
service status — service_fetch wasn't even imported in this file.

Add the missing service_id enforcement at the top of the iteration
loop:

  - If a stream_route references a service_id whose service can't be
    fetched (deleted, or not yet synced from etcd), log
    'failed to fetch service configuration by id: <id>' and skip
    the route.
  - If the service status is 0 (explicitly disabled), skip the route.

Combined with the conf_version trigger from the previous commit, a
service status flip / delete / late-sync now propagates into routing
decisions on the next match() call.

This is what the integration tests added in
t/stream-node/service-change-rebuild-router.t exercise; without this
patch, TESTs 2-4 fail because the disabled / deleted service is
ignored at routing time.

Signed-off-by: Abhishek Choudhary <[email protected]>

* refactor(stream-router): drop unreachable service lookup in rebuild

Apisix admin guarantees stream_routes' referenced services exist
(referenced services cannot be deleted), and the services schema does
not expose a status field, so there is no actionable outcome from a
per-route service fetch. Rebuilding on services.conf_version is enough.

Refocus the integration test on what apisix exposes: update the bound
service and verify routing continues to match through the
conf_version-driven rebuild.

---------

Signed-off-by: Abhishek Choudhary <[email protected]>
wistefan pushed a commit to wistefan/apisix that referenced this pull request Jun 16, 2026
* fix: rebuild stream router when services change

* test: add integration tests for stream router rebuild on service change

Cover the four scenarios the fix addresses end-to-end via stream
sockets: service status disable, re-enable, deletion, and recreation.
Each asserts that route matching reflects the new service state once
the rebuild path runs.

Ports the test file from api7-ee apache#1417 (the source PR for this
backport) which was omitted from the initial port.

* fix: skip stream routes whose service is missing or disabled

The previous commit started rebuilding the stream router whenever
services.conf_version changes, but the rebuild produced the same
routing decisions because create_router() didn't actually consult
service status — service_fetch wasn't even imported in this file.

Add the missing service_id enforcement at the top of the iteration
loop:

  - If a stream_route references a service_id whose service can't be
    fetched (deleted, or not yet synced from etcd), log
    'failed to fetch service configuration by id: <id>' and skip
    the route.
  - If the service status is 0 (explicitly disabled), skip the route.

Combined with the conf_version trigger from the previous commit, a
service status flip / delete / late-sync now propagates into routing
decisions on the next match() call.

This is what the integration tests added in
t/stream-node/service-change-rebuild-router.t exercise; without this
patch, TESTs 2-4 fail because the disabled / deleted service is
ignored at routing time.

Signed-off-by: Abhishek Choudhary <[email protected]>

* refactor(stream-router): drop unreachable service lookup in rebuild

Apisix admin guarantees stream_routes' referenced services exist
(referenced services cannot be deleted), and the services schema does
not expose a status field, so there is no actionable outcome from a
per-route service fetch. Rebuilding on services.conf_version is enough.

Refocus the integration test on what apisix exposes: update the bound
service and verify routing continues to match through the
conf_version-driven rebuild.

---------

Signed-off-by: Abhishek Choudhary <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants