Conversation
WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Ad4mModel
participant BatchManager
Caller->>Ad4mModel: save(batchId?)
alt batchId not provided
Ad4mModel->>BatchManager: createBatch()
Ad4mModel->>BatchManager: setCollections()
Ad4mModel->>BatchManager: commitBatch()
Ad4mModel->>Ad4mModel: getData()
else batchId provided
Ad4mModel->>BatchManager: setCollections()
Note right of Ad4mModel: Commit and getData deferred to caller
end
Ad4mModel-->>Caller: (return)
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (2)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Creating instances of Subject Classes / Ad4mModels will always at least result in two commits or more, since the constructor must at least write one link, plus the default
sourcelink.P-Diff-Sync has a fast-track method for updating the other agents via p2p remote call (instead of DHT sync) if there is only one commit difference.
So currently we never use this fast-track method.
The newly introduced batch mode can reduce an arbitrary number of link changes into one commit to the link language. Ad4mModel.save() already had an optional parameter with which the calling context could provide a batch ID, but had to initiate and commit the batch.
Now, if no batch ID is provided, save() will create a new batch and commit it at the end, resulting in only one commit to the link language.
This PR sits on top of #607 since it needs the deadlock fixes in there. Otherwise, extensive use of the batch mode would run into deadlocks almost certainly as seen in the tests.
Summary by CodeRabbit