跳转到主要内容

0.2.0-beta.2

引入协议 v7 数组按位置编码优化,修复维护唤醒、延迟缩容与防饥饿保护边界。

本版本将 Worker 通信协议更新至 v7,优化了普通数组的序列化开销,并加固了动态维护唤醒、延迟缩容、交互容量保护与自适应缓存重试等多项调度边界。

主要变化摘要

  • 协议 v7 数组按位置编码:普通数组的连续元素前缀不再保存下标字符串键,解码时原地恢复引用,同时完整保留稀疏数组空洞、自定义属性、对象图别名与特殊标量值。升级时需同步更新主线程包与 Worker 构建产物。
  • 完善 Blob / File 诊断与准备阶段说明:当附件超出限额时,错误消息明确包含已统计的附件字节数及需配置的 blobLimits 字段;明确调用线程准备窗口(maxPreparingTasks)与暂存边界。
  • 修复维护与回收后的队列唤醒:在动态维护结束或等待准入的主 Session 所属 Scope 关闭后,及时唤醒被占满池阻塞的任务与副本准入队列。
  • 加固延迟缩容与交互预留保护:在新任务准入前协调忙碌 Worker 的延迟缩容,严格保留必需 Session、结果租约、隔离 Worker 额度以及池内 interactiveWorkers 容量。
  • 修复预算防饥饿与自适应缓存重试:使非交互字节短缺的防饥饿保护与老化后的准入通道正确配合,并在高精度计时器提前触发时自动重装定时器;当扩容预算恢复时自动重试自适应缓存目标差额。

原始记录

以下内容完整保留 tasklane CHANGELOG 中此版本的英文原文,供核对完整技术变更:

  • Encode array prefixes without string index keys and decode them in place, preserving holes, custom properties, graph identity and scalar values. Protocol v7 requires updating the main package and Worker bundle together.
  • Report the required Blob/File bytes and the input/output blobLimits field on budget failures; clarify caller-thread preparation, preparation windows and scratch/adaptive boundaries.
  • Wake full-pool task queues after maintenance and Session admission after a waiting primary owner closes.
  • Reconcile deferred Worker shrink before new admission, preserving required Sessions, result leases and physical termination credits.
  • Apply starvation protection to non-interactive byte shortages while preserving interactive reserved capacity, including separate admission-class lanes after ageing.
  • Resume lazy Session reclamation after a failed termination, retaining quarantined Worker credits while trying healthy victims.
  • Preserve interactive Worker headroom during immediate and deferred pool shrink, including reuse of existing Workers.
  • Retry adaptive cache target mismatches when growth budget returns, without repeating failed reservations while capacity is still held.
  • Rearm early budget-wait timers so fractional timer delays cannot disable starvation protection.

相关文档