Skip to content

MDEV-25817 proxy protocol: successful login does not reset connect errors#5293

Open
vaintroub wants to merge 1 commit into
10.11from
MDEV-25817-proxy-protocol-connect-errors-reset
Open

MDEV-25817 proxy protocol: successful login does not reset connect errors#5293
vaintroub wants to merge 1 commit into
10.11from
MDEV-25817-proxy-protocol-connect-errors-reset

Conversation

@vaintroub

Copy link
Copy Markdown
Member

With proxy protocol thd_set_peer_addr() runs twice (proxy host, then the real client from the proxy header). Connect errors are accounted against the real client, but check_connection() incorrectly uses condition on the proxy host's count, rather than real client's address.

Fix: reset both the proxy host, and real client's connect errors on successful connection.

Added tests for incomplete handshake, and reset behavior, under proxy protocol, for both real client errors, and proxy host errors.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes an issue where successful logins under the PROXY protocol did not correctly reset the connect-error counters for the proxied client and the proxy host. It introduces a new flag have_proxy_protocol_connect_errors to track connection errors and ensures both the socket peer and the real client's error counters are reset upon a successful login. Additionally, test cases are added to verify this behavior. One review comment suggests a safer way to handle snprintf output length in the test code to prevent potential buffer over-reads.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tests/mysql_client_test.c Outdated
@vaintroub vaintroub force-pushed the MDEV-25817-proxy-protocol-connect-errors-reset branch 2 times, most recently from 8a90603 to 3eb1ee5 Compare June 29, 2026 11:37
…rors

With proxy protocol thd_set_peer_addr() runs twice (proxy host, then the
real client from the proxy header). Connect errors are accounted against
the real client, but check_connection() incorrectly uses condition on the
proxy host's count, rather than real client's address.

Fix: reset both the proxy host, and real client's connect errors on
successful connection.

Added tests for incomplete handshake, and reset behavior,
under proxy protocol, for both real client errors, and proxy host errors.
@vaintroub vaintroub force-pushed the MDEV-25817-proxy-protocol-connect-errors-reset branch from 3eb1ee5 to 41dd192 Compare June 29, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant