Skip to content

Commit

Permalink
feat(wal): unOverCapacityException will lead to memory leaks (#1952)
Browse files Browse the repository at this point in the history
* feat(wal): unOverCapacityException will lead to memory leaks

* feat(wal): unOverCapacityException will lead to momery leaks
  • Loading branch information
CLFutureX authored Aug 30, 2024
1 parent 4faae07 commit 061a987
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -417,16 +417,14 @@ public WALMetadata metadata() {
public AppendResult append(TraceContext context, ByteBuf buf, int crc) throws OverCapacityException {
// get current method name
TraceContext.Scope scope = TraceUtils.createAndStartSpan(context, "BlockWALService::append");
final long startTime = System.nanoTime();
try {
AppendResult result = append0(buf, crc);
result.future().whenComplete((nil, ex) -> TraceUtils.endSpan(scope, ex));
return result;
} catch (OverCapacityException ex) {
} catch (Throwable t) {
buf.release();
StorageOperationStats.getInstance().appendWALFullStats.record(TimerUtil.timeElapsedSince(startTime, TimeUnit.NANOSECONDS));
TraceUtils.endSpan(scope, ex);
throw ex;
TraceUtils.endSpan(scope, t);
throw t;
}
}

Expand Down

0 comments on commit 061a987

Please sign in to comment.