Skip to content

Commit

Permalink
add debug log for npe
Browse files Browse the repository at this point in the history
  • Loading branch information
Yrp committed Oct 31, 2018
1 parent 3f5ad62 commit a75ab1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
12 changes: 7 additions & 5 deletions src/main/java/org/tron/core/db2/core/SnapshotManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ public synchronized ISession buildSession(boolean forceEnable) {
disabled = false;
}

if (size > maxSize.get()) {
logger.info("****size:" + size + ", maxsize:" + maxSize.get());
size = maxSize.get();
flush();
}
// if (size > maxSize.get()) {
// logger.info("****size:" + size + ", maxsize:" + maxSize.get());
// size = maxSize.get();
// flush();
// }
// debug begin
// debug();
// debug end
Expand Down Expand Up @@ -205,6 +205,7 @@ public void updateSolidity(long oldSolidifiedBlockNum, long newSolidifedBlockNum
db.getHead().updateSolidity();
}
}
flush();
}

private boolean shouldBeRefreshed() {
Expand Down Expand Up @@ -251,6 +252,7 @@ private void refresh() {
// debug end
snapshots.add(next);
next = next.getNext();
--size;
}

// debug begin
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/org/tron/core/db2/core/SnapshotRoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

public class SnapshotRoot extends AbstractSnapshot<byte[], byte[]> {

@Getter
private Snapshot solidity;

public SnapshotRoot(String parentName, String name) {
Expand Down Expand Up @@ -84,17 +85,12 @@ public void reset() {
}

@Override
public synchronized Snapshot getSolidity() {
return solidity;
}

@Override
public synchronized void resetSolidity() {
public void resetSolidity() {
solidity = this;
}

@Override
public synchronized void updateSolidity() {
public void updateSolidity() {
solidity = solidity.getNext();
}
}

0 comments on commit a75ab1c

Please sign in to comment.