Commit 7dad23e7 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Add explicit log flushing when backend connections close to keep log...

Add explicit log flushing when backend connections close to keep log chronology. This is to avoid log lines for the same (reused) FD coming before the closing connection when load is high.

Fixes #739


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5160 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent c3885ff0
......@@ -370,6 +370,11 @@ vbe_GetVbe(struct sess *sp, struct vdi_simple *vs)
}
VSC_main->backend_toolate++;
WSL(sp->wrk, SLT_BackendClose, vc->fd, "%s", bp->vcl_name);
/* Checkpoint log to flush all info related to this connection
before the OS reuses the FD */
WSL_Flush(sp->wrk, 0);
TCP_close(&vc->fd);
VBE_DropRefConn(bp);
vc->backend = NULL;
......
......@@ -52,6 +52,11 @@ VDI_CloseFd(struct sess *sp)
bp = sp->vbc->backend;
WSL(sp->wrk, SLT_BackendClose, sp->vbc->fd, "%s", bp->vcl_name);
/* Checkpoint log to flush all info related to this connection
before the OS reuses the FD */
WSL_Flush(sp->wrk, 0);
TCP_close(&sp->vbc->fd);
VBE_DropRefConn(bp);
sp->vbc->backend = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment