Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

#[require_transactional] annotation #7004

Closed
xlc opened this issue Sep 2, 2020 · 0 comments · Fixed by #7261
Closed

#[require_transactional] annotation #7004

xlc opened this issue Sep 2, 2020 · 0 comments · Fixed by #7261
Labels
J0-enhancement An additional feature request.

Comments

@xlc
Copy link
Contributor

xlc commented Sep 2, 2020

Due to the limitation of current transactional overlay storage, it is recommended to not have too many nested with_transaction calls #6269 (comment).

So we end up many calls that have rollback after storage modification, expected to only be called within with_transaction.

Currently the only way to ensure those calls are used correctly is manual review, which are error-prone.

I would like to suggest a #[require_transactional] annotation, on release build, does nothing, but on debug std build / unit test, assert it is called within with_transaction.

@xlc xlc added the J0-enhancement An additional feature request. label Sep 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant