Sent from my iPhone
> On Jan 30, 2023, at 1:21 AM, Shiji Lu wrote:
>
> Good suggestions,
> There are three ways to write release in current pulsar and bookkeeper
> projects:
> 1.ByteBuf.release: Call release directly without handling any exceptions;
> 2.ReferenceCountUtil.release: return pro
Good suggestions,
There are three ways to write release in current pulsar and bookkeeper
projects:
1.ByteBuf.release: Call release directly without handling any exceptions;
2.ReferenceCountUtil.release: return processing status;
3. ReferenceCountUtil. safeRelease: without return value, print except
There is an open discussion on the Apache BooKeeper mailing list about
this kind of refactoring.
I appreciate this initiative because I see it as a tentative to reduce
the tech debt.
I think that it is pretty dangerous to do this kind of change.
Pulsar uses refcounting in a very advanced way and
I disagree with using `ReferenceCountUtil.safeRelease()` everywhere.
The implementation is throwing any Throwable:
```java
public static void safeRelease(Object msg) {
try {
release(msg);
} catch (Throwable var2) {
logger.warn("Failed to release a message: {}", msg, var2);