mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Always call TCP connect callback from within a worker context
This change ensures that a TCP connect callback is called from within the context of a worker thread in case of a low-level error when descriptors cannot be created (e.g. when there are too many open file descriptors).
This commit is contained in:
@@ -317,9 +317,13 @@ isc_nm_tcpconnect(isc_nm_t *mgr, isc_nmiface_t *local, isc_nmiface_t *peer,
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
if (isc__nm_in_netthread()) {
|
||||
sock->tid = isc_nm_tid();
|
||||
isc__nmsocket_clearcb(sock);
|
||||
isc__nm_connectcb(sock, req, result, false);
|
||||
} else {
|
||||
isc__nmsocket_clearcb(sock);
|
||||
sock->tid = isc_random_uniform(mgr->nworkers);
|
||||
isc__nm_connectcb(sock, req, result, true);
|
||||
}
|
||||
isc__nmsocket_clearcb(sock);
|
||||
isc__nm_connectcb(sock, req, result, false);
|
||||
atomic_store(&sock->closed, true);
|
||||
isc__nmsocket_detach(&sock);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user