Context
Architecture §3.4 defines VCL lifecycle management after push:
- After
vcl.use <new>: set old VCL to cold state via vcl.state <old> cold
- Wait 5-10 seconds before discarding (worker-thread references)
- Maintain max 3 VCL versions (configurable)
Current state
Agent PushVCL (admin.go:163-195):
- Loads and activates new VCL ✓
- Discards old VCL after 5s sleep ✓
- Does NOT set old VCL to
cold state first ✗
- Does NOT enforce max VCL count ✗
- Does NOT query
vcl.list to check existing versions ✗
Risk
Without vcl.state cold, rapid VCL pushes can leave worker threads referencing old VCL. Without max version enforcement, VCL versions accumulate on endpoint churn.
Implementation
In internal/agent/admin.go PushVCL:
- After
vcl.use <new>, call vcl.state <old> cold
- Before discard, query
vcl.list and discard all but the 3 most recent
- Add
vinyl_vcl_versions_loaded Prometheus gauge
Context
Architecture §3.4 defines VCL lifecycle management after push:
vcl.use <new>: set old VCL tocoldstate viavcl.state <old> coldCurrent state
Agent
PushVCL(admin.go:163-195):coldstate first ✗vcl.listto check existing versions ✗Risk
Without
vcl.state cold, rapid VCL pushes can leave worker threads referencing old VCL. Without max version enforcement, VCL versions accumulate on endpoint churn.Implementation
In
internal/agent/admin.goPushVCL:vcl.use <new>, callvcl.state <old> coldvcl.listand discard all but the 3 most recentvinyl_vcl_versions_loadedPrometheus gauge