mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Skip second termiantion if there is already a termination event in progress. This has been observed with clients clsoing their connection exactly at the same time when dnsmasq wants to close the connection itself due to a timeout (it thinks this client is stale).
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -1785,8 +1785,17 @@ static void prepare_blocking_metadata(void)
|
||||
// Called when a (forked) TCP worker is terminated by receiving SIGALRM
|
||||
// We close the dedicated database connection this client had opened
|
||||
// to avoid dangling database locks
|
||||
static volatile bool worker_already_terminating = false;
|
||||
void FTL_TCP_worker_terminating(bool finished)
|
||||
{
|
||||
if(worker_already_terminating)
|
||||
{
|
||||
logg("TCP worker already terminating!");
|
||||
return;
|
||||
}
|
||||
worker_already_terminating = true;
|
||||
|
||||
// Possible debug logging
|
||||
if(config.debug != 0)
|
||||
{
|
||||
const char *reason = finished ? "client disconnected" : "timeout";
|
||||
|
||||
Reference in New Issue
Block a user