forked from TrueCloudLab/frostfs-node
[#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:
parent
d6457ee485
commit
6c0b29e3e3
4 changed files with 73 additions and 9 deletions
|
@ -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...)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue