Skip to content

Commit 410066e

Browse files
committed
Excecise the two-step stevedore closing before/after waiting for VCL
... references to vanish
1 parent ab136ee commit 410066e

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-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: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,19 +198,28 @@ 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+
/* First send close warning */
208+
STV_Foreach(stv)
209+
if (stv->close != NULL)
210+
stv->close(stv, 0);
211+
}
212+
201213
void
202214
STV_close(void)
203215
{
204216
struct stevedore *stv;
205-
int i;
206217

207218
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-
}
219+
/* First send close warning */
220+
STV_Foreach(stv)
221+
if (stv->close != NULL)
222+
stv->close(stv, 1);
214223
}
215224

216225
/*-------------------------------------------------------------------

0 commit comments

Comments
 (0)