Commit ca302808 authored by Geoff Simmons's avatar Geoff Simmons

Check for the overflow condition before appending the req_endt string

parent 55f46917
Pipeline #168 skipped
......@@ -76,5 +76,5 @@ src/mq/kafka/test/test_*.log
src/mq/kafka/test/test_*.trs
src/test/test_*.log
src/test/test_*.trs
src/test/regress.sh.log
src/test/regress.sh.trs
src/test/*.sh.log
src/test/*.sh.trs
......@@ -590,13 +590,20 @@ dispatch(struct VSL_data *vsl, struct VSL_transaction * const pt[], void *priv)
}
snprintf(reqend_str, REQEND_T_LEN, "%s=%u.%06lu", REQEND_T_VAR,
(unsigned) latest_t.tv_sec, latest_t.tv_usec);
chunks = append(de, SLT_Timestamp, vxid, reqend_str, REQEND_T_LEN - 1);
if (chunks < 0) {
LOG_Log(LOG_ERR, "Chunks exhausted, DATA DISCARDED XID=%u: %s", vxid,
reqend_str);
if (de->end + REQEND_T_LEN > config.max_reclen) {
/* Data overflow */
LOG_Log(LOG_ERR, "Timestamp: Data too long, XID=%u, current length=%d, "
"DISCARDING data=[%s]", vxid, de->end, reqend_str);
len_overflows++;
}
else {
chunks = append(de, SLT_Timestamp, vxid, reqend_str, REQEND_T_LEN - 1);
if (chunks < 0)
LOG_Log(LOG_ERR, "Chunks exhausted, DATA DISCARDED XID=%u: %s",
vxid, reqend_str);
else
chunks_added += chunks;
}
else
chunks_added += chunks;
de->occupied = 1;
MON_StatsUpdate(STATS_OCCUPANCY, chunks_added, 0);
data_submit(de);
......
No preview for this file type
......@@ -22,18 +22,18 @@ rm -f $LOG $MSG
../trackrdrd -D -f toolong.log -l $LOG -d -c toolong.conf
# Just filter out the worker thread entries, and the read the last 18 lines
# Just filter out the worker thread entries, and the read the last lines
# in which the data read was logged, as well as the error messages.
CKSUM=$( grep -v 'Worker 1' $LOG | tail -18 | cksum)
if [ "$CKSUM" != '921644137 1188' ]; then
CKSUM=$( grep -v 'Worker 1' $LOG | tail -32 | cksum)
if [ "$CKSUM" != '2318467638 2021' ]; then
echo "ERROR: Too long test incorrect reader log cksum: $CKSUM"
exit 1
fi
# Just check the whole contents of the file MQ output.
MSGS=$(cat $MSG)
if [ "$MSGS" != 'key=32772: XID=32772&foo=bar&foo=bar&foo=bar&foo=bar&' ]; then
echo "ERROR: Too long test incorrect output: $MSGS"
# Check the contents of the file MQ output.
CKSUM=$(cksum $MSG)
if [ "$CKSUM" != "4088438759 125 $MSG" ]; then
echo "ERROR: Too long test incorrect output log cksum: $CKSUM"
exit 1
fi
......
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