> On Feb. 2, 2018, 2:09 p.m., András Piros wrote: > > core/src/main/java/org/apache/oozie/util/db/FailingHSQLDBDriverWrapper.java > > Lines 36-39 (patched) > > <https://reviews.apache.org/r/65481/diff/1/?file=1952234#file1952234line36> > > > > Usage of System#getProperty(String, String) would be much cleaner: > > > > > > https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#getProperty-java.lang.String-java.lang.String-
With the AlwaysFailingdriverMapper, I will not need this system property anymore > On Feb. 2, 2018, 2:09 p.m., András Piros wrote: > > core/src/main/java/org/apache/oozie/util/db/RuntimeExceptionInjector.java > > Lines 46-53 (patched) > > <https://reviews.apache.org/r/65481/diff/1/?file=1952236#file1952236line46> > > > > Would extract method refreshFailurePercent(), as well use > > https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#getProperty-java.lang.String-java.lang.String- > > > > But even better, I'd rather create three of this: > > - FailingHSQLDBDriverWrapper > > - NeverFailingHSQLDBDriverWrapper > > - AlwaysFailingHSQLDBDriverWrapper > > > > and reset this Configuration property for each of the unit tests. I have created the AlwaysFailingHSQLDBDriverWrapper, but I skipped the creation of NeverFailingHSQLDBDriverWrapper, because the defaut jdbdDriver is actually a "Never failing" one. - Kinga ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/65481/#review196707 ----------------------------------------------------------- On Feb. 6, 2018, 2:43 p.m., Kinga Marton wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/65481/ > ----------------------------------------------------------- > > (Updated Feb. 6, 2018, 2:43 p.m.) > > > Review request for oozie, András Piros and Attila Sasvari. > > > Repository: oozie-git > > > Description > ------- > > Upon SLACalculatorMemory.addRegistration, Oozie puts an entry into an > in-memory concurrent hashmap ("slaMap"), and later persists it in the Oozie > database. > However, if there is a failure during the database operation, a > JPAExecutorException is thrown, and the entry is not removed from the SLA map. > It may introduce inconsistency between the Oozie database and the SLA map. > To prevent this, a rollback mechanism (with proper logging) should be > implemented. It would also make sense to do more sanity/consistency check in > the Oozie server. > > > Diffs > ----- > > core/src/main/java/org/apache/oozie/sla/SLACalculatorMemory.java ef019e73 > > core/src/main/java/org/apache/oozie/util/db/AlwaysFailingHSQLDriverMapper.java > PRE-CREATION > core/src/main/java/org/apache/oozie/util/db/FailingConnectionWrapper.java > 0e310253 > core/src/main/java/org/apache/oozie/util/db/FailingHSQLDBDriverWrapper.java > fe9f08b1 > core/src/main/java/org/apache/oozie/util/db/FailingMySQLDriverWrapper.java > f0e2b181 > core/src/main/java/org/apache/oozie/util/db/ThreadVariables.java > PRE-CREATION > core/src/test/java/org/apache/oozie/sla/TestSLACalculatorMemory.java > ee906f45 > > > Diff: https://reviews.apache.org/r/65481/diff/2/ > > > Testing > ------- > > > Thanks, > > Kinga Marton > >
