2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

Merge branch '3079-always-enqueue-isc__nm_tcp_resumeread' into 'main'

Always enqueue isc__nm_tcp_resumeread()

Closes #3079

See merge request isc-projects/bind9!5695
This commit is contained in:
Ondřej Surý 2022-01-06 19:10:48 +00:00
commit 5d677c1b36
3 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,8 @@
5790. [bug] Enforce enqueuing TCP resumeread to prevent the
next read callback from being executed before the
current read callback has finished, and the worker
receive buffer has been marked as "freed". [GL #3079]
5789. [bug] Allow replacing expired zone signatures with
signatures created by the KSK. [GL #3049]

View File

@ -53,3 +53,7 @@ Bug Fixes
version of the zone, preventing resynchronization of zone contents
after ``named`` restart in case the unsigned zone file gets modified
while ``named`` is not running. This has been fixed. :gl:`#3071`
- Under certain circumstances, reading from the raw TCP channels used
for rndc and statistics could cause assertion failure. This has been
fixed. :gl:`#3079`

View File

@ -814,6 +814,7 @@ isc__nm_tcp_resumeread(isc_nmhandle_t *handle) {
isc__netievent_tcpstartread_t *ievent = NULL;
isc_nmsocket_t *sock = handle->sock;
isc__networker_t *worker = &sock->mgr->workers[sock->tid];
REQUIRE(sock->tid == isc_nm_tid());
@ -835,8 +836,18 @@ isc__nm_tcp_resumeread(isc_nmhandle_t *handle) {
ievent = isc__nm_get_netievent_tcpstartread(sock->mgr, sock);
isc__nm_maybe_enqueue_ievent(&sock->mgr->workers[sock->tid],
(isc__netievent_t *)ievent);
if (worker->recvbuf_inuse) {
/*
* If we happen to call the resumeread from inside the receive
* callback, the worker->recvbuf might still be in use, so we
* need to force enqueue the next read event.
*/
isc__nm_enqueue_ievent(worker, (isc__netievent_t *)ievent);
} else {
isc__nm_maybe_enqueue_ievent(worker,
(isc__netievent_t *)ievent);
}
}
void