The shutdown test sends 'rdnc status' commands in parallel with 'rndc stop' A new rndc connection arriving will reference the ACL environment to see whether the client is allowed to connect. Commit c0995bc3 added a mutex lock to ns_interfacemgr_getaclenv(), but if a new connection arrives while the interfaces are being purged during shutdown, that lock is already being held. If the the connection event slips in ahead of one of the netmgr's "stop listening" events on a worker thread, a deadlock can occur.
The fix is not to hold the interfacemgr lock while shutting down interfaces; only while actually traversing the interface list to identify interfaces needing shutdown.
Closes #3272 (closed)