Merge pull request #6566 from urbit/wicrum/live-before-abed

gall: always check that an agent isn't nuked before initializing `+ap`
This commit is contained in:
Ted Blackman 2023-05-09 11:45:01 -04:00 committed by GitHub
commit 7f623f2e04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -423,8 +423,7 @@
^+ mo-core ^+ mo-core
=. mo-core (mo-untrack-ship ship) =. mo-core (mo-untrack-ship ship)
=. mo-core (mo-filter-queue ship) =. mo-core (mo-filter-queue ship)
=/ agents=(list [name=term =yoke]) =/ agents=(list [name=term =yoke]) ~(tap by yokes.state)
(skim ~(tap by yokes.state) |=([* =yoke] =(%live -.yoke)))
=. outstanding.state =. outstanding.state
%- malt %- malt
%+ skip ~(tap by outstanding.state) %+ skip ~(tap by outstanding.state)
@ -434,7 +433,7 @@
|- ^+ mo-core |- ^+ mo-core
?~ agents ?~ agents
mo-core mo-core
=. mo-core =? mo-core ?=(%live -.yoke.i.agents)
=/ =routes [disclosing=~ attributing=ship] =/ =routes [disclosing=~ attributing=ship]
=/ app (ap-abed:ap name.i.agents routes) =/ app (ap-abed:ap name.i.agents routes)
ap-abet:(ap-breach:app ship) ap-abet:(ap-breach:app ship)
@ -475,12 +474,12 @@
?> ?=([%lag ~] wire) ?> ?=([%lag ~] wire)
?> ?=([%ames %clog *] sign-arvo) ?> ?=([%ames %clog *] sign-arvo)
:: ::
=/ agents=(list term) ~(tap in ~(key by yokes.state)) =/ agents=(list [=dude =yoke]) ~(tap by yokes.state)
|- ^+ mo-core |- ^+ mo-core
?~ agents mo-core ?~ agents mo-core
:: ::
=. mo-core =? mo-core ?=(%live -.yoke.i.agents)
=/ app (ap-abed:ap i.agents `our) =/ app (ap-abed:ap dude.i.agents `our)
ap-abet:(ap-clog:app ship.sign-arvo) ap-abet:(ap-clog:app ship.sign-arvo)
:: ::
$(agents t.agents) $(agents t.agents)
@ -705,7 +704,8 @@
++ mo-idle ++ mo-idle
|= dap=dude |= dap=dude
^+ mo-core ^+ mo-core
?. (~(has by yokes.state) dap) =/ yoke=(unit yoke) (~(get by yokes.state) dap)
?: |(?=(~ yoke) ?=(%nuke -.u.yoke))
~> %slog.0^leaf/"gall: ignoring %idle for {<dap>}, not running" ~> %slog.0^leaf/"gall: ignoring %idle for {<dap>}, not running"
mo-core mo-core
ap-abet:ap-idle:(ap-abed:ap dap `our) ap-abet:ap-idle:(ap-abed:ap dap `our)
@ -714,14 +714,15 @@
++ mo-nuke ++ mo-nuke
|= dap=dude |= dap=dude
^+ mo-core ^+ mo-core
?. (~(has by yokes.state) dap) =/ yoke=(unit yoke) (~(get by yokes.state) dap)
?: |(?=(~ yoke) ?=(%nuke -.u.yoke))
~> %slog.0^leaf/"gall: ignoring %nuke for {<dap>}, not running" ~> %slog.0^leaf/"gall: ignoring %nuke for {<dap>}, not running"
mo-core mo-core
~> %slog.0^leaf/"gall: nuking {<dap>}" ~> %slog.0^leaf/"gall: nuking {<dap>}"
=. mo-core ap-abet:ap-nuke:(ap-abed:ap dap `our) =. mo-core ap-abet:ap-nuke:(ap-abed:ap dap `our)
=- mo-core(yokes.state -) =- mo-core(yokes.state -)
%+ ~(jab by yokes.state) dap %+ ~(jab by yokes.state) dap
|= =yoke |= =^yoke
?: ?=(%nuke -.yoke) yoke ?: ?=(%nuke -.yoke) yoke
:- %nuke :- %nuke
%- ~(run by sky.yoke) %- ~(run by sky.yoke)
@ -756,6 +757,7 @@
|= [veb=? dap=term =routes care=term =path] |= [veb=? dap=term =routes care=term =path]
^- (unit (unit cage)) ^- (unit (unit cage))
:: ::
?. ?=([~ %live *] (~(get by yokes.state) dap)) [~ ~]
=/ app (ap-abed:ap dap routes) =/ app (ap-abed:ap dap routes)
(ap-peek:app veb care path) (ap-peek:app veb care path)
:: ::