优化 CtSph#lookProcessChain 创建拦截链方法(减少第一次创建拦截链时持有锁的占用时间,提升 rt,减少 gc 压力)
作者: LilMosey创建于 2025年3月28日更新于 2026年7月14日
Original logic:
chainMap is a Map with the volatile modifier. When the first time to get the ProcessorSlotChain, if it is empty, the old logic enters the synchronization block, creates a new map, and then copies the original data by putAll, finally completely replaces the chainMap, achieving visibility through volatile replacement of references.
内容来源: alibaba/Sentinel