mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Merge branch '3344-threadsanitizer-data-race-in-isc__nm_tcpdns_send-v9_18' into 'v9_18'
Move setting the sock->write_timeout to the async_*send [v9.18] See merge request isc-projects/bind9!6341
This commit is contained in:
commit
18881c15aa
3 changed files with 21 additions and 21 deletions
|
|
@ -1065,13 +1065,6 @@ isc__nm_tcp_send(isc_nmhandle_t *handle, const isc_region_t *region,
|
|||
uvreq->cb.send = cb;
|
||||
uvreq->cbarg = cbarg;
|
||||
|
||||
if (sock->write_timeout == 0) {
|
||||
sock->write_timeout =
|
||||
(atomic_load(&sock->keepalive)
|
||||
? atomic_load(&sock->mgr->keepalive)
|
||||
: atomic_load(&sock->mgr->idle));
|
||||
}
|
||||
|
||||
ievent = isc__nm_get_netievent_tcpsend(sock->mgr, sock, uvreq);
|
||||
isc__nm_maybe_enqueue_ievent(&sock->mgr->workers[sock->tid],
|
||||
(isc__netievent_t *)ievent);
|
||||
|
|
@ -1116,6 +1109,13 @@ isc__nm_async_tcpsend(isc__networker_t *worker, isc__netievent_t *ev0) {
|
|||
REQUIRE(sock->tid == isc_nm_tid());
|
||||
UNUSED(worker);
|
||||
|
||||
if (sock->write_timeout == 0) {
|
||||
sock->write_timeout =
|
||||
(atomic_load(&sock->keepalive)
|
||||
? atomic_load(&sock->mgr->keepalive)
|
||||
: atomic_load(&sock->mgr->idle));
|
||||
}
|
||||
|
||||
result = tcp_send_direct(sock, uvreq);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc__nm_incstats(sock, STATID_SENDFAIL);
|
||||
|
|
|
|||
|
|
@ -1090,13 +1090,6 @@ isc__nm_tcpdns_send(isc_nmhandle_t *handle, isc_region_t *region,
|
|||
uvreq->cb.send = cb;
|
||||
uvreq->cbarg = cbarg;
|
||||
|
||||
if (sock->write_timeout == 0) {
|
||||
sock->write_timeout =
|
||||
(atomic_load(&sock->keepalive)
|
||||
? atomic_load(&sock->mgr->keepalive)
|
||||
: atomic_load(&sock->mgr->idle));
|
||||
}
|
||||
|
||||
ievent = isc__nm_get_netievent_tcpdnssend(sock->mgr, sock, uvreq);
|
||||
isc__nm_maybe_enqueue_ievent(&sock->mgr->workers[sock->tid],
|
||||
(isc__netievent_t *)ievent);
|
||||
|
|
@ -1149,6 +1142,13 @@ isc__nm_async_tcpdnssend(isc__networker_t *worker, isc__netievent_t *ev0) {
|
|||
sock = ievent->sock;
|
||||
uvreq = ievent->req;
|
||||
|
||||
if (sock->write_timeout == 0) {
|
||||
sock->write_timeout =
|
||||
(atomic_load(&sock->keepalive)
|
||||
? atomic_load(&sock->mgr->keepalive)
|
||||
: atomic_load(&sock->mgr->idle));
|
||||
}
|
||||
|
||||
uv_buf_t bufs[2] = { { .base = uvreq->tcplen, .len = 2 },
|
||||
{ .base = uvreq->uvbuf.base,
|
||||
.len = uvreq->uvbuf.len } };
|
||||
|
|
|
|||
|
|
@ -1675,13 +1675,6 @@ isc__nm_tlsdns_send(isc_nmhandle_t *handle, isc_region_t *region,
|
|||
uvreq->cb.send = cb;
|
||||
uvreq->cbarg = cbarg;
|
||||
|
||||
if (sock->write_timeout == 0) {
|
||||
sock->write_timeout =
|
||||
(atomic_load(&sock->keepalive)
|
||||
? atomic_load(&sock->mgr->keepalive)
|
||||
: atomic_load(&sock->mgr->idle));
|
||||
}
|
||||
|
||||
ievent = isc__nm_get_netievent_tlsdnssend(sock->mgr, sock, uvreq);
|
||||
isc__nm_enqueue_ievent(&sock->mgr->workers[sock->tid],
|
||||
(isc__netievent_t *)ievent);
|
||||
|
|
@ -1704,6 +1697,13 @@ isc__nm_async_tlsdnssend(isc__networker_t *worker, isc__netievent_t *ev0) {
|
|||
REQUIRE(sock->type == isc_nm_tlsdnssocket);
|
||||
REQUIRE(sock->tid == isc_nm_tid());
|
||||
|
||||
if (sock->write_timeout == 0) {
|
||||
sock->write_timeout =
|
||||
(atomic_load(&sock->keepalive)
|
||||
? atomic_load(&sock->mgr->keepalive)
|
||||
: atomic_load(&sock->mgr->idle));
|
||||
}
|
||||
|
||||
result = tlsdns_send_direct(sock, uvreq);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc__nm_incstats(sock, STATID_SENDFAIL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue