[master] fa975cf22 Exercise the two-step stevedore closing before/after waiting for ...
Nils Goroll
nils.goroll at uplex.de
Wed Aug 27 15:05:05 UTC 2025
commit fa975cf220dd19c8e2505db290d22b6700b0d3a2
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Thu Mar 7 21:09:10 2024 +0100
Exercise the two-step stevedore closing before/after waiting for ...
VCL references to vanish
diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c
index ec3ad199f..3c90d3a44 100644
--- a/bin/varnishd/cache/cache_main.c
+++ b/bin/varnishd/cache/cache_main.c
@@ -560,6 +560,7 @@ child_main(int sigmagic, size_t altstksz)
VCA_Shutdown();
BAN_Shutdown();
EXP_Shutdown();
+ STV_warn();
VCL_Shutdown();
STV_close();
diff --git a/bin/varnishd/cache/cache_varnishd.h b/bin/varnishd/cache/cache_varnishd.h
index 0efa22a29..572ad2a0b 100644
--- a/bin/varnishd/cache/cache_varnishd.h
+++ b/bin/varnishd/cache/cache_varnishd.h
@@ -582,6 +582,7 @@ void V2D_Init(void);
/* stevedore.c */
void STV_open(void);
+void STV_warn(void);
void STV_close(void);
const struct stevedore *STV_next(void);
int STV_BanInfoDrop(const uint8_t *ban, unsigned len);
diff --git a/bin/varnishd/storage/stevedore.c b/bin/varnishd/storage/stevedore.c
index 9ab3ba501..a99558e59 100644
--- a/bin/varnishd/storage/stevedore.c
+++ b/bin/varnishd/storage/stevedore.c
@@ -198,19 +198,26 @@ STV_open(void)
AN(stv_h2_rxbuf);
}
+void
+STV_warn(void)
+{
+ struct stevedore *stv;
+
+ ASSERT_CLI();
+ STV_Foreach(stv)
+ if (stv->close != NULL)
+ stv->close(stv, 1);
+}
+
void
STV_close(void)
{
struct stevedore *stv;
- int i;
ASSERT_CLI();
- for (i = 1; i >= 0; i--) {
- /* First send close warning */
- STV_Foreach(stv)
- if (stv->close != NULL)
- stv->close(stv, i);
- }
+ STV_Foreach(stv)
+ if (stv->close != NULL)
+ stv->close(stv, 0);
}
/*-------------------------------------------------------------------
More information about the varnish-commit
mailing list