一句话:提出 NodeAV,基于执行轨迹预测性检测 Node.js 事件驱动应用中的原子性违反。
Node.js 广泛用作事件驱动服务端架构,一个任务常被划分为由 Node.js 非确定性调度的一组事件。开发者可能假设这组事件(原子事件组)应原子执行、不被中断,但 Node.js 并不保证该原子性,其他事件可能打断原子事件组,破坏原子性并导致意外结果。已有方法主要关注两个事件之间的事件竞争,无法检测一组事件间的高层原子性违反。本文提出 NodeAV,基于执行轨迹对 Node.js 应用进行预测性原子性违反检测:利用轨迹中事件间的 happens-before 关系自动识别应被原子处理的事件对,并采用预定义的原子性违反模式进行检测。作者在真实 Node.js 应用上评估了 NodeAV,实验结果表明其能有效检测这些应用中的原子性违反。
Node.js has been widely-used as an event-driven server-side architecture. To improve performance, a task in a Node.js application is usually divided into a group of events, which are non-deterministically scheduled by Node.js. Developers may assume that the group of events (named atomic event group) should be atomically processed, without interruption. However, the atomicity of an atomic event group is not guaranteed by Node.js, and thus other events may interrupt the execution of the atomic event group, break down the atomicity and cause unexpected results. Existing approaches mainly focus on event race among two events, and cannot detect high-level atomicity violations among a group of events. In this paper, we propose NodeAV, which can predictively detect atomicity violations in Node.js applications based on an execution trace. Based on happens-before relations among events in an execution trace, we automatically identify a pair of events that should be atomically processed, and use predefined atomicity violation patterns to detect atomicity violations. We have evaluated NodeAV on real-world Node.js applications. The experimental results show that NodeAV can effectively detect atomicity violations in these Node.js applications.