How can I see the number of rollbacks in my STM in Clojure?

后端 未结 3 1179
夕颜
夕颜 2021-01-11 10:59

How can I see the number of rollbacks in my STM in Clojure?

3条回答
  •  孤独总比滥情好
    2021-01-11 11:51

    If you're feeling frisky, you could hack the Clojure source and rebuild (it's easy to rebuild the Clojure source). Transaction retries happen in src/jvm/clojure/lang/LockingTransaction.java in the run() method. There's a big for loop there that goes until done or RETRY_LIMIT. The value of i when the loop exits should be the retry count.

提交回复
热议问题