Skip to content

Latest commit

 

History

History
131 lines (88 loc) · 5.17 KB

File metadata and controls

131 lines (88 loc) · 5.17 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

Security Fixes

  • Fix concurrency issues in ratelimiter: TOCTOU race condition between TryAccept and UpdateRateLimit (use single lock to protect check-and-create)
  • Fix infinite loop in connpool.ClearPool: removed dead loop waiting for activeNum == 0 and ineffective p = nil assignment
  • Fix busy-wait sleep in workpool.mustGetWorker: replaced time.Sleep(sleepInterval) with blocking channel wait

Performance Improvements

  • Optimize cache Len() from O(n) to O(1): avoid creating temporary map by directly using internal data structure size
  • Optimize cache HasKey() from O(n) to O(1): use direct map lookup instead of Keys() + linear search
  • Optimize cache Keys() and GetALL(): reduce from N lock acquisitions to single lock acquisition
  • Fix GetBetweenStr unnecessary byte-to-string conversions
  • Fix SliceShuffle to use Fisher-Yates algorithm for uniform randomness
  • Fix SliceRandList weak seed: use UnixNano() instead of Nanosecond()
  • Fix connpool.Pop() idle cleanup: collect connections to disconnect first, then release lock before disconnecting

CI/CD Improvements

  • Add race detector to unittest workflow (go test -race)
  • Add dependency caching to CI workflows for faster builds
  • Update dependabot schedule from daily to weekly with better grouping (k8s, otel, prometheus libs)
  • Update issue templates with version and Go version fields

Code Quality

  • Remove unused utils imports from cache plugins (lru, lfu, fifo, simple)
  • Add ArcList.Keys() method to support proper key iteration in ARC plugin
  • Fix unsafe type assertions in utils.ToStringDict, utils.InterfacesToStrings, utils.ToStrings, utils.ToMapStrings, utils.Strings: replace direct type assertions with ok-check pattern to prevent panic
  • Add safety documentation to utils.String2Bytes and utils.Bytes2String: clarify that returned slices share memory with original data and must not be modified

v1.0.2 - 2023-01-05

  • [Feat] Add simple cache & arc cache mode

v1.0.1 - 2023-01-05

  • [Feat] Add stream reader & writer package
  • [Feat] Add Bitmap reader & writer package

v1.0.0 - 2022-11-22

Added

Cache 内存缓存

  • 支持lrulfu随机淘汰算法,同时也支持时间过期淘汰;
  • 支持event回调: load加载回调、加载成功回调、对象淘汰回调;
  • 支持全局内存最大值设置(全局内存) 或 全局最大block(对象数)对象设置;
  • 支持 metircs 统计 key 的命中率情况分析;
  • 支持 Cache 内部数据 匹配查询(hash), 也支持近似值匹配查询(多阶二分查找);
  • 支持 内存无GC 高性能模式;

Config 配置管理

  • 支持 jsonini 和 环境变量 配置
  • 支持 默认值 设置与限制
  • 支持 内存使用 配置cli输出

Connect Pool 连接池管理

  • 支持 连接对象 Connect Obeject全局公用对象 Global Obeject数据对象 Data Objetc 管理
  • 支持 对象 保活最小可用最小空闲 管理
  • 支持 event回调: connect前、clear前、销毁前 回调;
  • 支持单机百万TPS管理

Discovery 注册中心 和 配置中心

  • 支持etcd注册、healthcheck、configure下载、心跳保活

Errno 通用错误库集合

  • 支持 多个 errors 压栈传递
  • 支持 errors 全局统一管理 和 标准序列号
  • 支持 自定义Error 管理

Logger 日志库(基于 uber zap)

  • 完全兼容golang标准库日志模块,拥有六种日志级别
  • 支持扩展的Hook机制
  • 支持日志输出格式:JSONFormatter和TextFormatter
  • 支持日志轮转:按log大小 和 按日期
  • 支持日志清理:按log总大小 和 按日期
  • 支持最高性能

Metrics 收集

  • 支持 prometheus 数据接口
  • 支持 opentelemetry 数据接口
  • 支持 atomic 内存态 统计

Queue 队列

  • 支持RingQueuePriorityQueue 内存队列管理
  • 支持无锁高性能队列使用

RateLimiter 限流包

  • 支持 令牌桶、滑动时间窗口 限流模式
  • 支持对对象限流: 可用于全局 和 部分sub对象限流 的 生成、处理 和 销毁

Temporary 大文件IO交互库

  • 支持超过一定大小、将临时缓冲转成临时文件
  • 支持异步写源信息:io.Reader转换成io.ReadSeeker
  • 支持异步读取源信息后关闭

WorkPool 任务池

  • 支持 任务 保活最小可用最小空闲 管理
  • 支持 event回调: 执行前、执行完成后、销毁前回调;
  • 支持 goroutine 链方式管理;整个栈内存支持全局设置
  • 支持 异常处理 failover 处理

Utils 通用库

  • 支持Map、Strings、Time等基础数据转换
  • 支持 version版本号比较
  • 支持数据diff

Fixed

  • Unittest、staticcheck、lint errors