You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
<
10BC8
link rel="modulepreload" href="https://github.githubassets.com/assets/chunk-dynamic-github-ui--issues--IssueViewer-149607dbbf0141a4.js" crossorigin="anonymous" />
The code treats Rule registration as "read-only" (is_write only matches Transact and Retract). The rule registration command is handled in the read-only path (no global write_lock held) and executed by a DatalogExecutor that may mutate the shared RuleRegistry. This could open a race with concurrent write transactions that hold write_lock, or with other rule registrations.
Concurrent registrations or concurrent mutation of rules vs writes could produce inconsistent view/order of rules vs facts and subtle concurrency bugs.
Suggested Fix
Treat rule registration as a write (include DatalogCommand::Rule in the list that requires acquiring write_lock), or
Ensure rule registration obtains the appropriate exclusive lock (e.g., upgrade to write lock for the rules RwLock)
Activity
fix(db): treat rule registration as write to prevent race
Merge pull request #102 from adityamukho/fix/issue-94-rule-registration