Commit 535183f8 authored by Geoff Simmons's avatar Geoff Simmons

trackrdrd: do not abort on fd mismatch

parent 27e6004d
...@@ -174,7 +174,7 @@ entry_assert_failure(const char *func, const char *file, int line, ...@@ -174,7 +174,7 @@ entry_assert_failure(const char *func, const char *file, int line,
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
static inline void static inline void
check_entry(hashentry *he, unsigned xid, unsigned tid) check_entry(hashentry *he, unsigned xid)
{ {
dataentry *de; dataentry *de;
CHECK_OBJ_NOTNULL(he, HASH_MAGIC); CHECK_OBJ_NOTNULL(he, HASH_MAGIC);
...@@ -185,7 +185,6 @@ check_entry(hashentry *he, unsigned xid, unsigned tid) ...@@ -185,7 +185,6 @@ check_entry(hashentry *he, unsigned xid, unsigned tid)
entry_assert(he, de != NULL); entry_assert(he, de != NULL);
entry_assert(he, de->magic == DATA_MAGIC); entry_assert(he, de->magic == DATA_MAGIC);
entry_assert(he, de->xid == xid); entry_assert(he, de->xid == xid);
entry_assert(he, de->tid == tid);
} }
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
...@@ -745,8 +744,16 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len, ...@@ -745,8 +744,16 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
} }
break; break;
} }
check_entry(he, xid, fd);
check_entry(he, xid);
de = he->de; de = he->de;
if (de->tid != fd) {
LOG_Log(LOG_ERR, "%s: fd mismatch, was %u, saw %u (XID=%u), "
"data DISCARDED [%.*s]",
VSL_tags[tag], de->tid, fd, xid, datalen, data);
htbl.drop_vcl_log++;
}
append(de, tag, xid, data, datalen); append(de, tag, xid, data, datalen);
de->hasdata = true; de->hasdata = true;
break; break;
...@@ -773,8 +780,14 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len, ...@@ -773,8 +780,14 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
} }
break; break;
} }
check_entry(he, xid, fd); check_entry(he, xid);
de = he->de; de = he->de;
if (de->tid != fd) {
LOG_Log(LOG_ERR, "%s: fd mismatch, was %u, saw %u (XID=%u), "
"data DISCARDED [%.*s]",
VSL_tags[tag], de->tid, fd, xid, datalen, data);
htbl.drop_reqend++;
}
sprintf(reqend_str, "%s=%u.%09lu", REQEND_T_VAR, sprintf(reqend_str, "%s=%u.%09lu", REQEND_T_VAR,
(unsigned) reqend_t.tv_sec, reqend_t.tv_nsec); (unsigned) reqend_t.tv_sec, reqend_t.tv_nsec);
......
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