Skip to content

Commit 27e77cf

Browse files
committed
Excecise the two-step stevedore closing before/after waiting for VCL
... references to vanish
1 parent d1134f5 commit 27e77cf

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

bin/varnishd/cache/cache_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ child_main(int sigmagic, size_t altstksz)
512512
VCA_Shutdown();
513513
BAN_Shutdown();
514514
EXP_Shutdown();
515+
STV_warn();
515516
VCL_Shutdown();
516517
STV_close();
517518

bin/varnishd/cache/cache_varnishd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ void V2D_Init(void);
573573

574574
/* stevedore.c */
575575
void STV_open(void);
576+
void STV_warn(void);
576577
void STV_close(void);
577578
const struct stevedore *STV_next(void);
578579
int STV_BanInfoDrop(const uint8_t *ban, unsigned len);

bin/varnishd/storage/stevedore.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,19 +198,26 @@ STV_open(void)
198198
AN(stv_h2_rxbuf);
199199
}
200200

201+
void
202+
STV_warn(void)
203+
{
204+
struct stevedore *stv;
205+
206+
ASSERT_CLI();
207+
STV_Foreach(stv)
208+
if (stv->close != NULL)
209+
stv->close(stv, 1);
210+
}
211+
201212
void
202213
STV_close(void)
203214
{
204215
struct stevedore *stv;
205-
int i;
206216

207217
ASSERT_CLI();
208-
for (i = 1; i >= 0; i--) {
209-
/* First send close warning */
210-
STV_Foreach(stv)
211-
if (stv->close != NULL)
212-
stv->close(stv, i);
213-
}
218+
STV_Foreach(stv)
219+
if (stv->close != NULL)
220+
stv->close(stv, 0);
214221
}
215222

216223
/*-------------------------------------------------------------------

0 commit comments

Comments
 (0)