Re: [DISCUSS] PIP-244: Refactor ByteBuf release method

2023-01-30 Thread Dave Fisher
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

Re: [DISCUSS] PIP-244: Refactor ByteBuf release method

2023-01-30 Thread Shiji Lu
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

Re: [DISCUSS] PIP-244: Refactor ByteBuf release method

2023-01-30 Thread Enrico Olivelli
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

Re: [DISCUSS] PIP-244: Refactor ByteBuf release method

2023-01-29 Thread Yunze Xu
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);