Skip to main content

Module locks

Module locks 

Source
Expand description

Per-repository serialisation locks for spine writes.

JSS forge funnels every issue-index mutation through serializeOn, one promise chain per <owner>/<repo>, so number allocation and read-modify-write cycles never race (and pulls and merges ride a second chain). RepoLocks is the async-mutex equivalent: one tokio::sync::Mutex per repository key.

Lock order, when both are needed: issue lock first, then pull lock (the label rename and delete cascade does exactly this). Hold a lock only across load, modify and save of the index, never across a loopback fetch.

Structsยง

ForgeLocks
The two lock families JSS keeps: issueLocks and pullLocks.
RepoLocks
A keyed set of async mutexes, one per <owner>/<repo>.