reftable: remove assert calls
The effect of assert is defined by compiler flags, so this code introduced a potential vector for corruption. Change-Id: I12197432e4351a5bd4aa24d352a19937721845c3 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
This commit is contained in:
parent
c020848dbb
commit
e4fd171da2
|
@ -163,7 +163,9 @@ protected boolean compactDuringCommit() {
|
||||||
* if tables cannot be opened.
|
* if tables cannot be opened.
|
||||||
*/
|
*/
|
||||||
protected DfsReftableStack stack() throws IOException {
|
protected DfsReftableStack stack() throws IOException {
|
||||||
assert getLock().isLocked();
|
if (!getLock().isLocked()) {
|
||||||
|
throw new IllegalStateException("most hold lock to access stack"); //$NON-NLS-1$
|
||||||
|
}
|
||||||
DfsObjDatabase odb = getRepository().getObjectDatabase();
|
DfsObjDatabase odb = getRepository().getObjectDatabase();
|
||||||
|
|
||||||
if (ctx == null) {
|
if (ctx == null) {
|
||||||
|
|
|
@ -138,7 +138,10 @@ public ReentrantLock getLock() {
|
||||||
* on I/O problems
|
* on I/O problems
|
||||||
*/
|
*/
|
||||||
private Reftable reader() throws IOException {
|
private Reftable reader() throws IOException {
|
||||||
assert lock.isLocked();
|
if (!lock.isLocked()) {
|
||||||
|
throw new IllegalStateException(
|
||||||
|
"must hold lock to access merged table"); //$NON-NLS-1$
|
||||||
|
}
|
||||||
if (mergedTables == null) {
|
if (mergedTables == null) {
|
||||||
mergedTables = openMergedReftable();
|
mergedTables = openMergedReftable();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue