Repository navigation
Conversation
…points by host and port Two defects in the sync Blue/Green plugin (aws#1352): - connect() and execute() re-selected the routing from self._bg_status, captured before the retry loop, instead of the latest published status. Once the switchover moved on, the old routing kept returning None and was picked again forever, so the call never returned. The loop now updates self._bg_status and re-selects from latest_status, falling through to a direct connect/execute when no routing matches, as the async plugin does. - BaseRouting.is_match compared the routing endpoint ("host" or "host:port") with host_info.url, which ends with "/", so endpoint-scoped routings never matched. It now compares with get_host_and_port(), like the JDBC wrapper. Same fix in the async plugin. Adds sync unit tests for both paths and updates the async is_match test, which encoded the trailing "/".
karenc-bq
approved these changes
Nov 10, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1352. Two defects in the sync Blue/Green plugin:
1. Re-selection loop hangs after the switchover moves on.
connect()andexecute()re-selected the routing fromself._bg_status, which was captured before the retry loop, instead of the latest published status. When a routing returnedNone(or an emptyValueContainer) and the switchover had already advanced, the same stale routing was picked again on every iteration and the call never returned. The loop now updatesself._bg_statusand re-selects fromlatest_status, and falls through to a direct connect/execute when no routing matches. This is what the async plugin already does.2. Endpoint-scoped routings never match.
BaseRouting.is_matchcompared the routing endpoint ("host"or"host:port", built by_get_host_and_port) withhost_info.url, which always ends with/. It now compares withhost_info.get_host_and_port().lower(), likegetHostAndPort()in the JDBC wrapper. Same change in the async plugin.Tests
tests/unit/test_blue_green_plugin.py:is_matchbyhost:portand bare host (a trailing/no longer matches); connect re-selects from the latest status and falls through; connect picks the routing from the latest status; execute re-selects and falls through.get_statususes a boundedside_effect, so a regression fails instead of hanging.tests/unit/test_aio_blue_green_plugin.py: theis_matchtest used"h:5432/"as the endpoint, which encoded the bug; changed to"h:5432"and added a bare-host case.mainand pass with this change.flake8andisort --check-onlyare clean on the touched files.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.