diff options
author | Misaki Shioi <[email protected]> | 2024-11-30 18:51:53 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2024-11-30 18:51:53 +0900 |
commit | 3d07754ee2c707343f79321b0fd358af3154709f (patch) | |
tree | ae4e05c8da3a2481bcaee53315af19bc4f0a2af9 /ext/socket/rubysocket.h | |
parent | fdf60d735cdfd42e11acedcb16f4b5c8b6896b38 (diff) |
Improve the conditions for clearing the Connection Attempt Delay upon connection failure (#12223)
* Improve the conditions for clearing the Connection Attempt Delay upon connection failure
This change addresses a case that was overlooked in ruby/ruby#12087.
In the previous change, the Connection Attempt Delay was cleared at the point of a connection failure only if both of the following conditions were met:
- No other sockets were attempting a connection
- There were addresses still available to start a new connection
In this update, the second condition has been removed.
As a result, if name resolution succeeds after a connection failure and new addresses are obtained, it will be able to immediately attempt a connection to one of them.
If there are no sockets attempting a connection, no addresses available for connection, and name resolution has completed, an exception will still be raised as before.
---
Additionally, the following minor fixes have been made:
* Refactor: Remove unnecessary members
Notes
Notes:
Merged-By: shioimm <[email protected]>
Diffstat (limited to 'ext/socket/rubysocket.h')
-rw-r--r-- | ext/socket/rubysocket.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h index d1ea3f98b7..16cc75aa7b 100644 --- a/ext/socket/rubysocket.h +++ b/ext/socket/rubysocket.h @@ -440,9 +440,8 @@ struct fast_fallback_getaddrinfo_entry struct fast_fallback_getaddrinfo_shared { - int notify, refcount, connection_attempt_fds_size; + int notify, refcount; int cancelled; - int *connection_attempt_fds; char *node, *service; rb_nativethread_lock_t *lock; struct fast_fallback_getaddrinfo_entry getaddrinfo_entries[FLEX_ARY_LEN]; |