fix(election-iomgr-refactor): integration bug fixes from 6.3 cluster test

- netio.c: skip SSL_new in endpoint_connect if ep->ssl already set (pre-created client ctx)
- ha.c: pre-create client SSL before endpoint_connect to avoid server-ctx handshake failure
- ha.c: fix double-free of vctx in endpoint_connect error path (let endpoint_fini own ep->data)
- ha.c: add endpoint_set_peer() call after endpoint_init for vote endpoints
- ha.c: fix endpoint_init args to AF_INET/SOCK_STREAM for outgoing vote sockets
- ha.c: wrap handle_request_vote voted_for check in ha->lock to prevent split-brain
- ha.c: skip immediate vote-deny for ECONNREFUSED in production; let election timeout handle
- delay.c: fix task_cmp signature to match ordq_cmp_fn_t (3 args: ctx, arg1, arg2)
This commit is contained in:
Rongsong Shen 2026-05-30 14:59:54 +00:00
parent e875cae7ad
commit 81ea5e8eb8
3 changed files with 44 additions and 44 deletions

View file

@ -665,12 +665,15 @@ int endpoint_connect(endpoint_t* ep, char* host, int port)
return rc;
}
ep->ssl = SSL_new(iomgr->ssl_ctx);
/* If ep->ssl is already set (e.g. pre-created with client context for
* outgoing connections), use it; otherwise create from iomgr->ssl_ctx. */
if (ep->ssl == NULL) {
ep->ssl = SSL_new(iomgr->ssl_ctx);
SSL_set_connect_state(ep->ssl);
}
SSL_set_fd(ep->ssl, ep->fd);
SSL_set_connect_state(ep->ssl);
set_fd_nonblocking(ep->fd);
ep->flags = 0;