Skip to content

Commit

Permalink
Ryan's feedback v3
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauernfeind committed Oct 17, 2023
1 parent ad446a2 commit 8c1628f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ public interface ViewportChangedCallback {

private final SourceRefresher refresher;

// Used to notify a listener that the viewport has changed. This is typically used by the caller to know when the
// server
// has acknowledged a viewport change request.
/**
* Used to notify a listener that the viewport has changed. This is typically used by the caller to know when the
* server has acknowledged a viewport change request.
*/
@Nullable
private ViewportChangedCallback viewportChangedCallback;

Expand Down Expand Up @@ -283,9 +284,19 @@ protected void instrumentedRefresh() {
final long startTm = System.nanoTime();
realRefresh();
recordMetric(stats -> stats.refresh, System.nanoTime() - startTm);
} catch (Exception e) {
beginLog(LogLevel.ERROR).append(": Failure during BarrageTable run: ").append(e).endl();
notifyListenersOnError(e, null);
} catch (Throwable err) {
beginLog(LogLevel.ERROR).append(": Failure during BarrageTable instrumentedRefresh: ")
.append(err).endl();
notifyListenersOnError(err, null);

if (viewportChangedCallback != null) {
viewportChangedCallback.onError(err);
viewportChangedCallback = null;
}
if (err instanceof Error) {
// rethrow if this was an error (which should not be swallowed)
throw err;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ public BarrageTable blockUntilComplete() throws InterruptedException {
}

if (holdingUpdateGraphLock) {
while (!checkIfCompletedOrThrow()) {
while (!checkIfCompleteOrThrow()) {
completedCondition.await();
}
} else {
synchronized (this) {
while (!checkIfCompletedOrThrow()) {
while (!checkIfCompleteOrThrow()) {
wait(); // BarrageSnapshotImpl lock
}
}
Expand Down

0 comments on commit 8c1628f

Please sign in to comment.