AbstractIterator 在 hasNext()
与 next()
方法中维护状态,且将这两个方法声明为 final
,子类仅需实现 computeNext()
即可,无需管理复杂的状态流转。
Risks of Maven Shade Plugin
使用 Maven Shade 插件时需注意若 Jar 中含有 so 等 native 库且使用的静态绑定时,若进行了 relocation 可能导致 UnsatisfiedLinkError
。
Reference
UnsatisfiedLinkError: how to shade native · Issue #6665 · netty/netty
JDK-8257671
谨慎使用 Discard*Policy
策略,若与 Future#get()
同时使用存在风险,丢弃的任务默认未进行取消操作。
Reference
JDK-8257671 ThreadPoolExecutor.Discard*Policy: rejected tasks are not cancelled
JDK-8286463 DiscardPolicy may block invokeAll forever
JDK-8160037 ExecutorService::shutdownNow may block invokeAll indefinitely
ThreadPoolExecutor.DiscardOldestPolicy (Java SE 17 & JDK 17)
Arthas #2662 & #2663
排查性能问题时发现的 Arthas 的几个小问题,顺手优化一下。
Reference
Make thread id uniformly displayed in decimal format by tianshuang · Pull Request #2662 · alibaba/arthas · GitHub
Adjust time display accuracy to milliseconds by tianshuang · Pull Request #2663 · alibaba/arthas · GitHub
Dubbo #13001
一个存在多年的问题,当消费者端消息发送耗时超过设置的调用超时时间时,目前的实现中提示信息为 Waiting server-side response timeout
,此时应该提示 Sending request timeout in client-side
。记录该问题是因为前一段时间有上游找过来说我这边的服务有问题,最后查出来是消费者端发送消息超时导致的,但是因为提示信息给得不对让消费者端误以为是提供者端服务的问题。
Reference
Fix incorrect timeout message by tianshuang · Pull Request #13001 · apache/dubbo · GitHub