S
slash
Storage Engines (stevedores) and Routers (loadmasters) for Varnish-Cache
-
Nils Goroll authored
For panics from the LRU thread, we have, so far, been stepping in the dark if we did not have a core dump with the segment/object. This commit adds a dummy struct busyobj to the lru thread with the only purpose of providing the linkage for the Varnish-Cache panic handler to call our panic handler to in turn dump information about the currently handled objcore. Tested with the following patch ... diff --git a/src/fellow_cache.c b/src/fellow_cache.c index e82f49a1..464921aa 100644 --- a/src/fellow_cache.c +++ b/src/fellow_cache.c @@ -5253,6 +5253,8 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru) CHECK_OBJ_NOTNULL(fco, FELLOW_CACHE_OBJ_MAGIC); lru->panic_bo.fetch_objcore = fco->oc; assert(fco->lru == lru); + if (fco->oc != NULL) + WRONG("test"); r = pthread_mutex_trylock(&fco->mtx); if (r != 0) { assert(r == EBUSY); ... vtc/fellow_b00062.vtc gives us information about the object as expected: **** v1 CLI RX|thr.busyobj = 0x7f1835607088 { **** v1 CLI RX| end = (nil), **** v1 CLI RX| retries = 0, **** v1 CLI RX| ws = 0x7f18356070d0 { **** v1 CLI RX| .magic = 0x00000000 EXPECTED: WS_MAGIC=0x35fac554 **** v1 CLI RX| } **** v1 CLI RX| ws_bo = (nil), **** v1 CLI RX| objcore[fetch] = 0x7f1835a0c000 { **** v1 CLI RX| refcnt = 1, **** v1 CLI RX| flags = {}, **** v1 CLI RX| exp_flags = {refd}, **** v1 CLI RX| exp = {1732892693.194625, 1.000000, 1.000000, 86400.000000}, **** v1 CLI RX| objhead = 0x7f1835a05070, **** v1 CLI RX| stevedore = 0x7f1843ecf000 (fellow fellow) { **** v1 CLI RX| priv2 = 2179073, fco = 0x7f1840f0c000 { **** v1 CLI RX| logstate = 4, lru = 0x7f1835607000, ntouched = 0, **** v1 CLI RX| fcr = { ok { r.integer = 1089519616, r.ptr = 0x7f1840f0c000}}, **** v1 CLI RX| fdo_fcs = 0x7f1840f0c0d8 { **** v1 CLI RX| state = FCO_INCORE, fcs_onlru = 1, fco_infdb = 1, **** v1 CLI RX| lcb_add_head = 0, lcb_add_tail = 0, lcb_remove = 0, fco_lru_mutate = 0, **** v1 CLI RX| refcnt = 1, fco = 0x7f1840f0c000, **** v1 CLI RX| disk_seg = 0x7f1840f08008 { **** v1 CLI RX| fht = 3, segnum = 0, **** v1 CLI RX| seg = {.off = 2179072, .size = 4096}, **** v1 CLI RX| fh[0..8] = 8422c2ee75247f6f, **** v1 CLI RX| }, **** v1 CLI RX| alloc = {.ptr = 0x7f1840f08000, .size = 4096}, **** v1 CLI RX| union { .fcs_len = 139742145445888, .fco_fdo = 0x7f1840f08000 }, **** v1 CLI RX| }, **** v1 CLI RX| esidata = 0x7f1840f0c128 { **** v1 CLI RX| state = FCAA_USABLE, fcs_onlru = 0, fco_infdb = 0, **** v1 CLI RX| lcb_add_head = 0, lcb_add_tail = 0, lcb_remove = 0, fco_lru_mutate = 0, **** v1 CLI RX| refcnt = 0, fco = 0x7f1840f0c000, **** v1 CLI RX| disk_seg = 0x7f1840f080f0 { **** v1 CLI RX| fht = 3, segnum = 0, **** v1 CLI RX| seg = {.off = 0, .size = 0}, **** v1 CLI RX| fh[0..8] = 0000000000000000, **** v1 CLI RX| }, **** v1 CLI RX| alloc = {.ptr = (nil), .size = 0}, **** v1 CLI RX| union { .fcs_len = 0, .fco_fdo = (nil) }, **** v1 CLI RX| }, **** v1 CLI RX| fcsl = 0x7f1840f0c168 {idx = 0, lsegs = 63, fcsl_sz 0, fdsl_sz = 0, fdsl_idx = 0, fdsl_lsegs = 63, fdsl_nsegs = 63 }, **** v1 CLI RX| fcsl = 0x7f1840f4b000 {idx = 1, lsegs = 70, fcsl_sz 4096, fdsl_sz = 4096, fdsl_idx = 1, fdsl_lsegs = 70, fdsl_nsegs = 70 }, **** v1 CLI RX| fcsl = 0x7f1840f93000 {idx = 2, lsegs = 70, fcsl_sz 4096, fdsl_sz = 4096, fdsl_idx = 2, fdsl_lsegs = 70, fdsl_nsegs = 70 }, **** v1 CLI RX| fcsl = 0x7f1840fdb000 {idx = 3, lsegs = 53, fcsl_sz 3136, fdsl_sz = 4096, fdsl_idx = 3, fdsl_lsegs = 53, fdsl_nsegs = 53 }, **** v1 CLI RX| fcsl = NULL **** v1 CLI RX| }, **** v1 CLI RX| }, **** v1 CLI RX| }, **** v1 CLI RX| flags = {}, **** v1 CLI RX| storage = (nil), **** v1 CLI RX| director_resp = director_req, **** v1 CLI RX| vcl[vcl] = NULL **** v1 CLI RX|}, **** v1 CLI RX| Motivated by #83
Name |
Last commit
|
Last update |
---|---|---|
LICENSES | ||
doc/perf | ||
logs | ||
src | ||
tools/coccinelle | ||
.editorconfig | ||
.gitignore | ||
BUGS.rst | ||
CHANGES.rst | ||
COPYING | ||
DEVELOPER.rst | ||
INSTALL.rst | ||
Makefile.am | ||
README.rst | ||
bootstrap | ||
configure.ac |