mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-06-22 00:57:24 +00:00
Refine update locking interface
* Remove Supervisor lockfile cleanup SIGTERM listener * Modify lockfile.getLocksTaken to read files from the filesystem * Remove in-memory tracking of locks taken in favor of filesystem * Require both `(resin-)updates.lock` to be locked with `nobody` UID for service to count as locked by the Supervisor Signed-off-by: Christina Ying Wang <christina@balena.io>
This commit is contained in:
@ -17,7 +17,7 @@ import {
|
||||
ContractViolationError,
|
||||
InternalInconsistencyError,
|
||||
} from '../lib/errors';
|
||||
import { getServicesLockedByAppId } from '../lib/update-lock';
|
||||
import { getServicesLockedByAppId, LocksTakenMap } from '../lib/update-lock';
|
||||
import { checkTruthy } from '../lib/validation';
|
||||
|
||||
import App from './app';
|
||||
@ -150,7 +150,7 @@ export async function getRequiredSteps(
|
||||
downloading,
|
||||
availableImages,
|
||||
containerIdsByAppId,
|
||||
locksTaken: getServicesLockedByAppId(),
|
||||
locksTaken: await getServicesLockedByAppId(),
|
||||
});
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ export async function inferNextSteps(
|
||||
containerIdsByAppId = {} as {
|
||||
[appId: number]: UpdateState['containerIds'];
|
||||
},
|
||||
locksTaken = getServicesLockedByAppId(),
|
||||
locksTaken = new LocksTakenMap(),
|
||||
} = {},
|
||||
) {
|
||||
const currentAppIds = Object.keys(currentApps).map((i) => parseInt(i, 10));
|
||||
|
Reference in New Issue
Block a user