-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Generic Transactions to Bundle Async Operations #257
Comments
Notes:
In the meantime, please add Edit: also useful: https://www.cs.utexas.edu/~lorenzo/papers/SurveyFinal.pdf |
Also note this goes hand-in-hand with #175 — Error notification system. |
OK, so basic psuedocode + notes from the call on how this is done: PseudocodeIn the .vue files, for every "submit"-like action that has a series of asynchronous call steps and publishLogEntry steps, we do the following:
Notes
ExamplesExamples of sections that would be converted to using this method include: |
Per today's convo, it turns out the that handling the first type of "revertable transactions" (i.e. the "asynchronous call step" part) is not necessary, and in fact trying to save+revert state would break things in the event that a So it makes sense just do nothing about that, and the Therefore this issue and any related PRs is just about the 2nd type of transactions, the ones that modify external state / the log (i.e. the ones calling publishLogEntry). Nothing should be done regarding the first type (the local async actions). |
Hmm, we should make sure to first serialize this array to disk before doing anything else, and to do so in a manner that guarantees that all the steps are serialized correctly (and not say, 2 out of 3 steps before data corruption caused by power failure). To do that we can hash the steps together in a json blob and save them to the database along with the hash of the blob. If upon deserialization the hash doesn't match the blob, then we know something got corrupted and the entire series of steps should be tossed out. Also:
PR #320 needs to not forget about handling that part ☝️ See especially this review comment |
Think this isn't necessary anymore. |
Problem
When async calls fail the leave the application in an invalid state
Solutions
Create a Generic Transaction object that can be use to bundle async operations together in a way that can be resumed when an error occurs. If an error occurs the failure should save the transaction state in the database to be resumed later.
The text was updated successfully, but these errors were encountered: