Mailing List Archive

r1736 - in branches/1.1: . bin/varnishd include
Author: des
Date: 2007-07-20 13:03:11 +0200 (Fri, 20 Jul 2007)
New Revision: 1736

Modified:
branches/1.1/
branches/1.1/bin/varnishd/cache_expire.c
branches/1.1/bin/varnishd/cache_fetch.c
branches/1.1/bin/varnishd/cache_pipe.c
branches/1.1/include/stat_field.h
Log:
Merged revisions 1727-1729 via svnmerge from
svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache

........
r1727 | des | 2007-07-20 10:38:22 +0200 (Fri, 20 Jul 2007) | 2 lines

Let the LRU code worry about this.
........
r1728 | des | 2007-07-20 10:39:45 +0200 (Fri, 20 Jul 2007) | 2 lines

Paranoia.
........
r1729 | des | 2007-07-20 10:40:33 +0200 (Fri, 20 Jul 2007) | 2 lines

Count backend requests.
........



Property changes on: branches/1.1
___________________________________________________________________
Name: svnmerge-integrated
- /trunk/varnish-cache:1-1722
+ /trunk/varnish-cache:1-1722,1727-1729

Modified: branches/1.1/bin/varnishd/cache_expire.c
===================================================================
--- branches/1.1/bin/varnishd/cache_expire.c 2007-07-20 10:24:03 UTC (rev 1735)
+++ branches/1.1/bin/varnishd/cache_expire.c 2007-07-20 11:03:11 UTC (rev 1736)
@@ -82,8 +82,7 @@
EXP_Terminate(struct object *o)
{
LOCK(&exp_mtx);
- if (o->lru_stamp)
- LRU_Remove(o);
+ LRU_Remove(o);
if (o->heap_idx)
binheap_delete(exp_heap, o->heap_idx);
if (o->deathrow.tqe_next) {

Modified: branches/1.1/bin/varnishd/cache_fetch.c
===================================================================
--- branches/1.1/bin/varnishd/cache_fetch.c 2007-07-20 10:24:03 UTC (rev 1735)
+++ branches/1.1/bin/varnishd/cache_fetch.c 2007-07-20 11:03:11 UTC (rev 1736)
@@ -286,6 +286,9 @@
return (1);
}

+ /* XXX is this the right place? */
+ VSL_stats->backend_req++;
+
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);

Modified: branches/1.1/bin/varnishd/cache_pipe.c
===================================================================
--- branches/1.1/bin/varnishd/cache_pipe.c 2007-07-20 10:24:03 UTC (rev 1735)
+++ branches/1.1/bin/varnishd/cache_pipe.c 2007-07-20 11:03:11 UTC (rev 1736)
@@ -46,7 +46,7 @@
rdf(struct pollfd *fds, int idx)
{
int i, j;
- char buf[BUFSIZ];
+ char buf[BUFSIZ], *p;

i = read(fds[idx].fd, buf, sizeof buf);
if (i <= 0 || fds[1-idx].events == 0) {
@@ -55,14 +55,17 @@
shutdown(fds[idx].fd, SHUT_RD);
shutdown(fds[1-idx].fd, SHUT_WR);
fds[idx].events = 0;
- } else {
- j = write(fds[1-idx].fd, buf, i);
- if (i != j) {
+ return;
+ }
+ for (p = buf; i > 0; i -= j, p += j) {
+ j = write(fds[1-idx].fd, p, i);
+ if (j < 0) {
VSL(SLT_Debug, fds[idx].fd, "Pipe Shut write(write)");
VSL(SLT_Debug, fds[1-idx].fd, "Pipe Shut read(write)");
shutdown(fds[idx].fd, SHUT_WR);
shutdown(fds[1-idx].fd, SHUT_RD);
fds[1-idx].events = 0;
+ return;
}
}
}

Modified: branches/1.1/include/stat_field.h
===================================================================
--- branches/1.1/include/stat_field.h 2007-07-20 10:24:03 UTC (rev 1735)
+++ branches/1.1/include/stat_field.h 2007-07-20 11:03:11 UTC (rev 1736)
@@ -89,3 +89,5 @@
MAC_STAT(sm_nobj, uint64_t, 'i', "outstanding allocations")
MAC_STAT(sm_balloc, uint64_t, 'i', "bytes allocated")
MAC_STAT(sm_bfree, uint64_t, 'i', "bytes free")
+
+MAC_STAT(backend_req, uint64_t, 'a', "Backend requests made")