Add context to transaction waiter #147

Open
opened 2025-02-27 17:21:01 +00:00 by vdomnich-yadro · 0 comments
Member

Method Wait in commonclient.Waiter hangs up when discrete time of blockchain stops.

Describe the solution you'd like

To prevent hang up and to control duration of awaiting from application's side it would be nice to have a WaitCtx method that takes a context as a parameter. And canceling of the context stops transaction awaiting.

Describe alternatives you've considered

Alternatively it would be possible to have a fixed timeout value in waiter options. However, fixed timeout is not flexible enough to control awaiting in different situations.

Also, it is possible to add context to existing method Wait. However, it would be preferred to preserve backward compatibility with the existing applications and just to add a new method next to the existing one.

## Is your feature request related to a problem? Please describe. Method [Wait](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/commonclient/waiter.go#L47) in [commonclient.Waiter](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/commonclient/waiter.go#L31) hangs up when discrete time of blockchain stops. ## Describe the solution you'd like To prevent hang up and to control duration of awaiting from application's side it would be nice to have a `WaitCtx` method that takes a context as a parameter. And canceling of the context stops transaction awaiting. ## Describe alternatives you've considered Alternatively it would be possible to have a fixed timeout value in waiter options. However, fixed timeout is not flexible enough to control awaiting in different situations. Also, it is possible to add context to existing method `Wait`. However, it would be preferred to preserve backward compatibility with the existing applications and just to add a new method next to the existing one.
vdomnich-yadro self-assigned this 2025-02-27 17:21:18 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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-contract#147
No description provided.