Pass context.Context to StorageEngine Open #653

Closed
opened 2023-08-25 12:16:25 +00:00 by aarifullin · 1 comment
Member

When application is being initilized it would be better off to pass ctx to here - we can cancel storage opening if initilization is cancelled and introduce tracing for some methods

So, these methods should recieve context

  • StorageEngine.Open
  • Shard.Open
  • For all methods, that implements interface{ Open(bool) error } and make it -> interface{ Open(context.Context, bool) error } (see here)
When application is being [initilized](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/cmd/frostfs-node/main.go#L80) it would be better off to pass `ctx` to [here](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/cmd/frostfs-node/main.go#L97) - we can cancel storage opening if initilization is cancelled and introduce tracing for some methods So, these methods should recieve context - [StorageEngine.Open](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/local_object_storage/engine/control.go#L24) - [Shard.Open](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/local_object_storage/shard/control.go#L44) - For all methods, that implements `interface{ Open(bool) error }` and make it -> `interface{ Open(context.Context, bool) error }` (see [here](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/local_object_storage/shard/control.go#L63))
aarifullin added the
enhancement
frostfs-node
good first issue
labels 2023-08-25 12:16:25 +00:00
Owner
  1. Add context to Open() methods
  2. Add proper cancelation where possible (in case some worker launched in all use context.TODO or context.Background -- replace it with a new context.
1. Add context to `Open()` methods 2. Add proper cancelation where possible (in case some worker launched in all use `context.TODO` or `context.Background` -- replace it with a new context.
elebedeva was assigned by fyrchik 2023-08-28 10:19:38 +00:00
fyrchik added this to the v0.37.0 milestone 2023-08-28 14:25:07 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#653
No description provided.