-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix busy-wait on client SSL connection #4588
Merged
Merged
Conversation
This file contains 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
Errors and EOF returned by 'recv' are now properly handled, isolated from the return value ('r') from the later and conditional 'SSL_read'. Previously, a busy loop was possible in the following scenario: 1. A client connection was closed, leading to a return of 0 by 'recv', and 'errno' to be set with 'EAGAIN'. 2. Error handling is performed taking into account a never performed call to 'SSL_read' (as if this '0' was a result for this call). 3. The call to 'SSL_get_error' returns with 'SSL_ERROR_SYSCALL', as a result of using this invalid param of '0' (which for 'SSL_read' would mean non-retryable error), and the non-reset 'errno' would still be 'EAGAIN'. 4. This would create the illusion of an interrupted read. So a new read is tried again, while in reality the socket is closed. This busy loop will continue until 'POLLHUP' is received when we attempt to write back to the client and a 'RST' is received as a response.
Several calls inside 'proxy_debug_func' (specially if database logging is enabled) could alter 'errno', which could influence error handling.
retest this please |
retest this please |
JavierJF
force-pushed
the
v2.x-client_ssl_busy_wait
branch
from
July 15, 2024 19:37
3010f72
to
cf2163f
Compare
- Ensure new values has been written to 'system_cpu'. - Use the correct (runtime) interval for the computation. - Issue warning when supplied interval != runtime (rounded value).
Variables specifying timing intervals, like 'stats_mysql_connections', may get rounded to the closer, valid time interval. Now a warning is issued for making the user aware of this rounding operation.
retest this please |
Some tests assume ProxySQL should be in an idle state, only affected by either idle connections or monitoring actions. This idle state could be perturbed by the continuous actions of the scheduler in Core Cluster nodes.
- Simplified and unified condition waiting checks. - Added new helper function for fetching cluster core nodes.
- Refactor nodes fetching using new helper functions. - Simplified and documented 'plan' tests count computation. - Other minor cleanups.
Test is now aware of 'cluster_mysql_servers_sync_algorithm'. In case of 'runtime_mysql_servers' propagation, the test disables monitoring since it creates servers in hostgroups with active monitoring, if config doesn't allows 'runtime' propagation, the test assumes everything will just work. This should be a common pattern for tests creating fake servers.
- Adds config option with microseconds resolution, ON by default. - Preserves TAP convention for messages to prevent tooling breaking.
Closed
3 tasks
This list hold tracking errors that in practice are equivalent to ER_UNKNOWN_SYSTEM_VARIABLE and that we want to handle in the same way.
JavierJF
force-pushed
the
v2.x-client_ssl_busy_wait
branch
from
July 18, 2024 10:39
85c80f1
to
b91b6b8
Compare
Simplify scheduler code disabling/enabling for Cluster Core nodes.
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.
Main Fix
This PR fixes the following busy-loop scenario when handling SSL client connections, the description is in terms of reads handling within
MySQL_Data_Stream::read_from_net
function:Minor Fix
This PR makes
proxy_debug_func
save/restore theerrno
value. This can prevent issues of logging influencing error handling.Extra fixes