EarthChen commented on PR #16538:
URL: https://github.com/apache/dubbo/pull/16538#issuecomment-6413351281

   Thanks @binbin0325. The `Cleanable` fix looks correct to me. I confirmed 
that every `instanceof Cleanable` check in `ExchangeCodec`, `TransportCodec`, 
`DecodeableRpcResult` and `DecodeableRpcInvocation` was always false because of 
the wrapper, and that the three new tests pass.
   
   I pushed one extra commit (2051e63cb2) to this branch:
   
   - `ProxyObjectOutput#writeBytes(byte[], int, int)` called 
`target.writeBytes(v)`, so it wrote the whole array and ignored `off` and 
`len`. It now forwards `off` and `len`. This was mentioned in #16537.
   - I added a regression test. It failed before the fix and passes now.
   - I found no caller of this method on `ObjectOutput` inside Dubbo, so the 
bug only affects custom serializations and user code. It is not a blocker for 
the `Cleanable` fix.
   
   Notes, none of which block this PR:
   
   - With this change, `Hessian2ObjectInput/Output#cleanup()` (which calls 
`reset()`) runs again. This matches the behavior before the wrapper was 
introduced in #12357.
   - `DecodeableRpcResult#decode` calls `cleanup()` after the `switch`, not in 
a `finally` block. If decoding throws, `cleanup()` is skipped. 
`DecodeableRpcInvocation` already uses `finally`. This was already the case 
before this PR, so a follow-up is fine.
   - A test that loads `hessian2` through `ExtensionLoader` and asserts 
`instanceof Cleanable` would guard against a future wrapper hiding it again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to