mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 21:47:59 +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:
parent
1349142333
commit
8510c5cd59
@ -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 (result != ISC_R_SUCCESS) {
|
||||||
if (isc__nm_in_netthread()) {
|
if (isc__nm_in_netthread()) {
|
||||||
sock->tid = isc_nm_tid();
|
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);
|
atomic_store(&sock->closed, true);
|
||||||
isc__nmsocket_detach(&sock);
|
isc__nmsocket_detach(&sock);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user