DESC Try to rollback when a transaction fails to commit EDESC When a transaction fails to commit, try to rollback it before returning. The huge comment in the code says it all, read it. While at it, fix a very small but theoretically possible race: we need to unlink the transaction before freeing it. Otherwise, we could: task 1 task 2 free_tid(5) get_tid() (returns 5) write the transaction file unlink(5) And we have just unlinked a valid transaction!