Skip to content

Commit

Permalink
Fix order of COLD events for directors vs. VCL
Browse files Browse the repository at this point in the history
vcldir_retire() only sends a VCL_EVENT_COLD when the vcl is warm. In
other words, it (rightly) asserts that a COLD event (if any) has
alrady been posted when a director is deleted on a COLD vcl.

Yet, when the director is deleted upon a COLD vmod event, this assertion
was wrong, because the COLD events for directors were only posted after
vmod events.

Given that vmods do things like deleting directors, it appears (more)
correct to post VDI COLD events before VMOD COLD events.
  • Loading branch information
nigoroll committed Jan 15, 2024
1 parent 3cd7308 commit c44bd67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/varnishd/cache/cache_vcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,9 @@ vcl_set_state(struct vcl *vcl, const char *state, struct vsb **msg)
if (vcl->busy == 0 && vcl->temp->is_warm) {
vcl->temp = VTAILQ_EMPTY(&vcl->ref_list) ?
VCL_TEMP_COLD : VCL_TEMP_COOLING;
vcl_BackendEvent(vcl, VCL_EVENT_COLD);
AZ(vcl_send_event(vcl, VCL_EVENT_COLD, msg));
AZ(*msg);
vcl_BackendEvent(vcl, VCL_EVENT_COLD);
}
else if (vcl->busy)
vcl->temp = VCL_TEMP_BUSY;
Expand Down
1 change: 1 addition & 0 deletions include/vrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
*
* NEXT (2024-03-15)
* [cache.h] (struct req).filter_list renamed to vdp_filter_list
* order of vcl/vmod and director COLD events reversed to directors first
* 18.1 (2023-12-05)
* vbf_objiterate() implementation changed #4013
* 18.0 (2023-09-15)
Expand Down

0 comments on commit c44bd67

Please sign in to comment.