在 JVM 中记录/重放执行代码的 Java 解决方案
我们试图找到一个非确定性发生的错误(嗯,它是确定性的,但我们只是不知道实际上是什么导致了它)并且它每几个小时才发生一次。
我们读取大量网络数据,并且有很多线程,因此它很可能来自输入、竞争条件或两者的组合,但在大多数情况下是不可重现的。
我想知道是否有任何 JVM 记录器/重放器可以存储 JVM 中发生的所有事情,以便我们可以逐步执行它并重新创建异常的步骤。
我找到了一个。 (我不会发布它,这样人们就不会认为我正在尝试为产品做广告。),但我想知道是否还有其他产品,更重要的是,人们已经使用过其他产品,并且可以报告这一点工作顺利。
编辑添加:
我找到了重播解决方案。我从来没有使用过它,也从未听说过它,所以我不知道它到底有多好。
我们使用 JProfiler,但我认为它实际上并不支持记录/重放所有内容。
We have a bug we're trying to find that happens non-deterministically (well, it's deterministic, but we just don't know what's actually causing it) and it only happens once every couple hours.
We read a lot of network data, and we have many threads, so there's a likelihood it's from an input, race condition, or combination of both, but for the most part, unreproducible.
I'm wondering if there are any JVM recorders / replayers out there that can store everything that happened in a JVM so we can then go through it step by step and recreate the steps to the exception.
I've found one. (I'm not going to post it so people don't think I'm trying to advertise a product.), but I'm wondering if there are others, and more importantly, others that people have used, and can report that work well.
Edit to add:
I've found Replay Solutions. I've never used it, and I've never heard of it, so I don't know how good it actually is.
We use JProfiler, but I don't think it actually has support to record/replay everything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议使用 Chronon 它对我来说效果很好,但我还没有广泛使用它。
I would suggest using Chronon it worked well for me, but I haven't used it extensively yet.
记录所有内容是不可能的(除了微基准测试之外),特别是因为线程交错:性能下降/速度减慢会太严重。如果您尝试重现的问题是并发错误,您可能需要尝试执行部分日志记录并使用 SMT 解决方案完成交错的系统:
http://www.gsd.inesc-id.pt/~nmachado/software/Symbiosis_Tutorial.html
到此为止据我所知,这是最新的系统,并且是开源的(java、c 和 c++ 版本)。
It is not possible (except maybe for micro-benchmarks) to record everything, especially because of the thread interleavings: the performance degradation/slowdown would be too severe. If the problem you are trying to reproduce is a concurrency bug you may want to try systems that perform partial logging and complete the interleaving using SMT solving:
http://www.gsd.inesc-id.pt/~nmachado/software/Symbiosis_Tutorial.html
To the extent of my knowledge, this is the most recent system, and is available open-source (in java, c and c++).