Files
releases/storage/inmem
Torin Sandall 6dd37dd2a7 storage: Add safety checks to in-memory store
This commit adds two checks to the in-memory store to detect improper
use of transactions:

1. Mark aborted/committed transactions as stale and error if an
operation is attempted on a stale transaction. Previously callers
could perform unsafe concurrent operations on stale transactions
without noticiing.

2. Check that supplied transactions are from the underlying store and
not another store. We could consider deprecating the store APIs and
moving them onto the transaction to prevent this kind of mistake in
the future.

With these changes the store will panic on unregister and abort
calls if any of these invariants are violated. Panicing is preferable
to failing silently.

Note, we still have the issue of recursive transactions resulting in
deadlock. Our options there are to implement more sophisticated
locking inside the in-memory store or modify the API so that the store
can update the passed context.Context with a sentinel value.

Fixes #1594

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-05 22:38:03 +09:00
..
2018-03-08 11:02:41 -08:00
2018-07-02 09:19:15 -07:00