quchen / amoeba

Amœba is a distributed network.
Other
18 stars 1 forks source link

Potential livelock in ClientPool.hs #19

Closed quchen closed 10 years ago

quchen commented 10 years ago

If the DB sizes don't change and the transaction in ClientPool.balanceEdges is retrying, the function might lock. This could be avoided by having a periodically changed nonsense TVar in the transaction, but that seems a bit hacky.

  1. Is there really a potential livelock there?
  2. How to fix it? The TVar solution is pretty hacky.
quchen commented 10 years ago

Revisiting this issue, in 269cb0eb67fb6041349aa1e7d5dc74326df8fe28 it can't livelock (and I assume this whole ticket was a brain fart).

A livelock would be possible only if the transaction itself called retry on some condition, but it is actually re-run as a whole each time the loop is executed.