MCPcopy Index your code
hub / github.com/rilldata/rill / Lock

Method Lock

runtime/controller.go:816–826  ·  view source on GitHub ↗

Lock locks the controller's catalog and delays scheduling of new reconciliations until the lock is released. It can only be called from within a reconciler invocation. While the lock is held, resources can only be edited by a caller using the ctx passed to Lock.

(ctx context.Context)

Source from the content-addressed store, hash-verified

814// It can only be called from within a reconciler invocation.
815// While the lock is held, resources can only be edited by a caller using the ctx passed to Lock.
816func (c *Controller) Lock(ctx context.Context) {
817 inv := invocationFromContext(ctx)
818 if inv == nil {
819 panic("Lock called outside of a reconciler invocation")
820 }
821 if inv.holdsLock {
822 panic("Lock called by invocation that already holds the lock")
823 }
824 inv.holdsLock = true
825 c.mu.Lock()
826}
827
828// Unlock releases the lock acquired by Lock.
829func (c *Controller) Unlock(ctx context.Context) {

Callers 15

SetOrgMethod · 0.45
GitHelperMethod · 0.45
HandleRepoTransferMethod · 0.45
initLoggerFunction · 0.45
DumpResourcesFunction · 0.45
RunMethod · 0.45
WaitUntilIdleMethod · 0.45
SubscribeMethod · 0.45
lockMethod · 0.45
reloadConfigMethod · 0.45
closeMethod · 0.45
addMethod · 0.45

Calls 1

invocationFromContextFunction · 0.85

Tested by

no test coverage detected