[master] de16dba Drop counter client_drop_late, it is already counted in sess_drop, and the counter had race issues.

Poul-Henning Kamp phk at varnish-cache.org
Mon Jan 14 10:14:08 CET 2013


commit de16dba24abf2d24678e3d7a438ad0341ad1dde3
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 14 09:13:12 2013 +0000

    Drop counter client_drop_late, it is already counted in sess_drop,
    and the counter had race issues.
    
    Polish vsc_f_main.h a bit while here

diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 40416a0..51d9bc4 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -257,7 +257,6 @@ SES_ScheduleReq(struct req *req)
 	sp->task.priv = req;
 
 	if (Pool_Task(pp->pool, &sp->task, POOL_QUEUE_FRONT)) {
-		VSC_C_main->client_drop_late++;
 		AN (req->vcl);
 		VCL_Rel(&req->vcl);
 		SES_Delete(sp, SC_OVERLOAD, NAN);
@@ -281,10 +280,8 @@ SES_Handle(struct sess *sp, double now)
 	AN(pp->pool);
 	sp->task.func = ses_sess_pool_task;
 	sp->task.priv = sp;
-	if (Pool_Task(pp->pool, &sp->task, POOL_QUEUE_FRONT)) {
-		VSC_C_main->client_drop_late++;
+	if (Pool_Task(pp->pool, &sp->task, POOL_QUEUE_FRONT))
 		SES_Delete(sp, SC_OVERLOAD, now);
-	}
 }
 
 /*--------------------------------------------------------------------
diff --git a/include/tbl/vsc_f_main.h b/include/tbl/vsc_f_main.h
index d9c78ce..133025e 100644
--- a/include/tbl/vsc_f_main.h
+++ b/include/tbl/vsc_f_main.h
@@ -57,19 +57,28 @@
  *
  */
 
+/*--------------------------------------------------------------------
+ * Globals, not related to traffic
+ */
+
+VSC_F(uptime,			uint64_t, 0, 'a',
+    "Child process uptime",
+	""
+)
+
+
 /*---------------------------------------------------------------------
  * Sessions
- *    see: cache_acceptor.c and cache_pool.c
  */
 
 VSC_F(sess_conn,		uint64_t, 1, 'c',
     "Sessions accepted",
 	"Count of sessions succesfully accepted"
 )
+
 VSC_F(sess_drop,		uint64_t, 1, 'c',
     "Sessions dropped",
-	"Count of sessions silently dropped due to lack of session memory."
-	"  See parameter 'max_sess'."
+	"Count of sessions silently dropped due to lack of worker thread."
 )
 
 VSC_F(sess_fail,		uint64_t, 1, 'c',
@@ -366,6 +375,8 @@ VSC_F(sess_herd,		uint64_t, 1, 'a',
 	""
 )
 
+/*--------------------------------------------------------------------*/
+
 VSC_F(shm_records,		uint64_t, 0, 'a',
     "SHM records",
 	""
@@ -387,6 +398,8 @@ VSC_F(shm_cycles,		uint64_t, 0, 'a',
 	""
 )
 
+/*--------------------------------------------------------------------*/
+
 VSC_F(sms_nreq,			uint64_t, 0, 'a',
     "SMS allocator requests",
 	""
@@ -408,11 +421,15 @@ VSC_F(sms_bfree,		uint64_t, 0, 'i',
 	""
 )
 
+/*--------------------------------------------------------------------*/
+
 VSC_F(backend_req,		uint64_t, 0, 'a',
     "Backend requests made",
 	""
 )
 
+/*--------------------------------------------------------------------*/
+
 VSC_F(n_vcl,			uint64_t, 0, 'a',
     "N vcl total",
 	""
@@ -426,7 +443,7 @@ VSC_F(n_vcl_discard,		uint64_t, 0, 'a',
 	""
 )
 
-/**********************************************************************/
+/*--------------------------------------------------------------------*/
 
 VSC_F(bans,			uint64_t, 0, 'g',
    "Count of bans",
@@ -468,7 +485,7 @@ VSC_F(bans_dups,		uint64_t, 0, 'c',
 	"Count of bans replaced by later identical bans."
 )
 
-/**********************************************************************/
+/*--------------------------------------------------------------------*/
 
 VSC_F(hcb_nolock,		uint64_t, 1, 'a',
     "HCB Lookups without lock",
@@ -483,6 +500,8 @@ VSC_F(hcb_insert,		uint64_t, 0, 'a',
 	""
 )
 
+/*--------------------------------------------------------------------*/
+
 VSC_F(esi_errors,		uint64_t, 0, 'a',
     "ESI parse errors (unlock)",
 	""
@@ -491,14 +510,8 @@ VSC_F(esi_warnings,		uint64_t, 0, 'a',
     "ESI parse warnings (unlock)",
 	""
 )
-VSC_F(client_drop_late,		uint64_t, 0, 'a',
-    "Connection dropped late",
-	""
-)
-VSC_F(uptime,			uint64_t, 0, 'a',
-    "Client uptime",
-	""
-)
+
+/*--------------------------------------------------------------------*/
 
 VSC_F(dir_dns_lookups,		uint64_t, 0, 'a',
     "DNS director lookups",
@@ -517,11 +530,15 @@ VSC_F(dir_dns_cache_full,	uint64_t, 0, 'a',
 	""
 )
 
+/*--------------------------------------------------------------------*/
+
 VSC_F(vmods,			uint64_t, 0, 'i',
     "Loaded VMODs",
 	""
 )
 
+/*--------------------------------------------------------------------*/
+
 VSC_F(n_gzip,			uint64_t, 0, 'a',
     "Gzip operations",
 	""
@@ -531,7 +548,7 @@ VSC_F(n_gunzip,			uint64_t, 0, 'a',
 	""
 )
 
-/**********************************************************************/
+/*--------------------------------------------------------------------*/
 
 VSC_F(vsm_free,			uint64_t, 0, 'g',
     "Free VSM space",



More information about the varnish-commit mailing list