[#922] storage engine: Prevent any operations after first Close call

Make `BlockExecution` / `ResumeExecution` to not release per-shard worker
pools. Make `StorageEngine.Close` to block these methods and any
data-related operations. It is still releases the pools.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-11-11 16:58:07 +03:00 committed by Alex Vanin
parent d6457ee485
commit 6c0b29e3e3
4 changed files with 73 additions and 9 deletions

View file

@ -116,3 +116,13 @@ func addAttribute(obj *object.RawObject, key, val string) {
attrs = append(attrs, attr)
obj.SetAttributes(attrs...)
}
func testNewEngineWithShardNum(t *testing.T, num int) *StorageEngine {
shards := make([]*shard.Shard, 0, num)
for i := 0; i < num; i++ {
shards = append(shards, testNewShard(t, i))
}
return testNewEngineWithShards(shards...)
}