Skip to content

Commit

Permalink
fix mutex documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fredcarle committed Jan 27, 2023
1 parent 49c65b7 commit 4e60ca2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datastore/concurrent_txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import (
type concurrentTxn struct {
ds.Txn

// A given Badger transaction isn't made to be concurrently operated on. It is therefore not thread safe.
// Some datastore don't support concurrent operation within a single transaction. `concurrentTxn` with its
// mutex enable those concurrent operations. This was implemented for DefraDB's DAG sync process.
// Since the DAG sync process is highly concurrent and has been made to operate on a single transaction
// to eliminate the potential for deadlock (DAG being left in an incomplete state without a way to obviously
// detect it), we need to add a mutex to ensure thread safety.
Expand Down

0 comments on commit 4e60ca2

Please sign in to comment.