Author: kpvdr
Date: 2008-05-13 17:54:11 -0400 (Tue, 13 May 2008)
New Revision: 2045
Modified:
store/trunk/cpp/lib/jrnl/wrfc.cpp
store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp
store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.hpp
store/trunk/cpp/tests/jrnl/run-journal-tests
Log:
Fixed the hang problem for exceptions thrown while running jtt. Also removed jtt test dir
after each run.
Modified: store/trunk/cpp/lib/jrnl/wrfc.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wrfc.cpp 2008-05-13 20:26:09 UTC (rev 2044)
+++ store/trunk/cpp/lib/jrnl/wrfc.cpp 2008-05-13 21:54:11 UTC (rev 2045)
@@ -71,6 +71,8 @@
_reset_ok = true;
_owi = rdp->_owi;
_frot = rdp->_frot;
+ if (is_full())
+ rotate();
}
else
{
Modified: store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp 2008-05-13 20:26:09 UTC (rev 2044)
+++ store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp 2008-05-13 21:54:11 UTC (rev 2045)
@@ -154,9 +154,9 @@
stop(true);
_tcrp->set_stop_time();
}
- catch (const rhm::journal::jexception& e) { _tcrp->add_exception(e); }
- catch (const std::exception& e) { _tcrp->add_exception(e.what()); }
- catch (...) { _tcrp->add_exception("Unknown exception"); }
+ catch (const rhm::journal::jexception& e) { _tcrp->add_exception(e); panic();
}
+ catch (const std::exception& e) { _tcrp->add_exception(e.what()); panic(); }
+ catch (...) { _tcrp->add_exception("Unknown exception"); panic(); }
_tcrp->set_stop_time();
_tcp->add_result(_tcrp);
}
@@ -217,9 +217,9 @@
}
flush(true);
}
- catch (const rhm::journal::jexception& e) { _tcrp->add_exception(e); }
- catch (const std::exception& e) { _tcrp->add_exception(e.what()); }
- catch (...) { _tcrp->add_exception("Unknown exception"); }
+ catch (const rhm::journal::jexception& e) { _tcrp->add_exception(e); panic();
}
+ catch (const std::exception& e) { _tcrp->add_exception(e.what()); panic(); }
+ catch (...) { _tcrp->add_exception("Unknown exception"); panic(); }
}
void
@@ -305,9 +305,9 @@
}
}
}
- catch (const rhm::journal::jexception& e) { _tcrp->add_exception(e); }
- catch (const std::exception& e) { _tcrp->add_exception(e.what()); }
- catch (...) { _tcrp->add_exception("Unknown exception"); }
+ catch (const rhm::journal::jexception& e) { _tcrp->add_exception(e); panic();
}
+ catch (const std::exception& e) { _tcrp->add_exception(e.what()); panic(); }
+ catch (...) { _tcrp->add_exception("Unknown exception"); panic(); }
}
void
@@ -354,9 +354,9 @@
flush(true);
}
}
- catch (const rhm::journal::jexception& e) { _tcrp->add_exception(e); }
- catch (const std::exception& e) { _tcrp->add_exception(e.what()); }
- catch (...) { _tcrp->add_exception("Unknown exception"); }
+ catch (const rhm::journal::jexception& e) { _tcrp->add_exception(e); panic();
}
+ catch (const std::exception& e) { _tcrp->add_exception(e.what()); panic(); }
+ catch (...) { _tcrp->add_exception("Unknown exception"); panic(); }
}
void
@@ -397,6 +397,16 @@
return p.get();
}
+void
+jrnl_instance::panic()
+{
+ // In the event of a panic or exception condition, release all waiting CVs
+ _rd_aio_cv.broadcast();
+ _wr_full_cv.broadcast();
+ _rd_list_cv.broadcast();
+ _deq_list_cv.broadcast();
+}
+
// static AIO callback fns
void
Modified: store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.hpp 2008-05-13 20:26:09 UTC (rev 2044)
+++ store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.hpp 2008-05-13 21:54:11 UTC (rev 2045)
@@ -137,6 +137,8 @@
void txn(const rhm::journal::data_tok* dtokp, const bool commit);
rhm::journal::data_tok* prep_txn_dtok(const rhm::journal::data_tok* dtokp);
+ void panic();
+
// static callbacks
static void aio_rd_callback(jcntl* journal, std::vector<u_int16_t>&
pil);
static void aio_wr_callback(jcntl* journal,
std::vector<journal::data_tok*>& dtokl);
Modified: store/trunk/cpp/tests/jrnl/run-journal-tests
===================================================================
--- store/trunk/cpp/tests/jrnl/run-journal-tests 2008-05-13 20:26:09 UTC (rev 2044)
+++ store/trunk/cpp/tests/jrnl/run-journal-tests 2008-05-13 21:54:11 UTC (rev 2045)
@@ -2,24 +2,25 @@
fail=0
num_jrnls=1
+rm -rf /tmp/test_0*
# Run jtt using default test set
echo
echo "===== Mode 1: New journal instance, no recover ====="
+jtt/jtt --path jtt --csv jtt/jtt.csv --format-chk --num-jrnls $num_jrnls || fail=1
rm -rf /tmp/test_0*
-jtt/jtt --path jtt --csv jtt/jtt.csv --format-chk --num-jrnls $num_jrnls || fail=1
echo
echo "===== Mode 2: Re-use journal instance, no recover ====="
+jtt/jtt --path jtt --csv jtt/jtt.csv --reuse-instance --format-chk --num-jrnls $num_jrnls
|| fail=1
rm -rf /tmp/test_0*
-jtt/jtt --path jtt --csv jtt/jtt.csv --reuse-instance --format-chk --num-jrnls $num_jrnls
|| fail=1
echo
echo "===== Mode 3: New journal instance, recover previous test journal ====="
+jtt/jtt --path jtt --csv jtt/jtt.csv --recover-mode --format-chk --num-jrnls $num_jrnls
|| fail=1
rm -rf /tmp/test_0*
-jtt/jtt --path jtt --csv jtt/jtt.csv --recover-mode --format-chk --num-jrnls $num_jrnls
|| fail=1
echo
echo "===== Mode 4: Re-use journal instance, recover previous test journal
====="
+jtt/jtt --path jtt --csv jtt/jtt.csv --reuse-instance --recover-mode --format-chk
--num-jrnls $num_jrnls || fail=1
rm -rf /tmp/test_0*
-jtt/jtt --path jtt --csv jtt/jtt.csv --reuse-instance --recover-mode --format-chk
--num-jrnls $num_jrnls || fail=1
echo
exit $fail
Show replies by date