Skip to content

Missing EMFILE handling in vsmw_append_record() #3663

@nigoroll

Description

@nigoroll

Under high load with hundreds of thousands of requests serializing on a small number of objects, for which the backend returned an error with a long response time, the following Panic was observed, triggered by exhaustion of available file descriptors.
The Panic output is deliberately shortened to avoid publication of identifiable information, but I am convinced that it contains sufficient information for identifying and fixing the bug.

Error: Child (28) Panic at: Fri, 06 Aug 2021 20:33:54 GMT
Assert error in vsmw_append_record(), common/common_vsmw.c line 204:
  Condition(fd >= 0) not true.
version = varnish-trunk revision f4c8362fce819db3536763d084f0018b2f3d0e5a, vrt api = 13.0
ident = Linux,3.10.0-862.14.4.el7.x86_64,x86_64,-jnone,-smalloc,-sdefault,-hcritbit,epoll
now = 85539400.878266 (mono), 1628280667.227404 (real)
Backtrace:
  0x44b189: /opt/varnish/sbin/varnishd() [0x44b189]
  0x44b85f: /opt/varnish/sbin/varnishd() [0x44b85f]
  0x4e22b7: /opt/varnish/sbin/varnishd(VAS_Fail+0x53) [0x4e22b7]
  0x479530: /opt/varnish/sbin/varnishd() [0x479530]
  0x47983e: /opt/varnish/sbin/varnishd() [0x47983e]
  0x47ab07: /opt/varnish/sbin/varnishd(VSMW_Free+0x1c7) [0x47ab07]
  0x478f03: /opt/varnish/sbin/varnishd(VRT_VSC_Destroy+0x1a4) [0x478f03]
  0x4bd191: /opt/varnish/sbin/varnishd(VSC_vbe_Destroy+0x59) [0x4bd191]
  0x419fa3: /opt/varnish/sbin/varnishd() [0x419fa3]
  0x41a1a8: /opt/varnish/sbin/varnishd() [0x41a1a8]
errno = 24 (Too many open files)

Metadata

Metadata

Assignees

No one assigned

    Labels

    a=ImplementIssue is ready for implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions