gall: support %doff-ing specific apps and/or ships

This gives us more control over exactly which subscriptions get culled,
which is useful in debugging and targetted recovery scenarios.
This commit is contained in:
fang 2022-08-10 20:33:07 +02:00
parent 6b836bb56d
commit 04b7b86cae
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
4 changed files with 15 additions and 8 deletions

View File

@ -1,5 +1,6 @@
:- %say
|= $: [now=@da eny=@uvJ bec=beak]
[~ ~]
~
[dude=(unit dude:gall) ship=(unit ship)]
==
[%helm-doff ~]
[%helm-doff dude ship]

View File

@ -261,9 +261,9 @@
(emit %pass /helm/cors/reject %arvo %e %reject-origin origin)
::
++ poke-doff
|= ~
|= [dude=(unit dude:gall) ship=(unit ship)]
=< abet
(emit %pass /helm/doff %arvo %g %doff ~)
(emit %pass /helm/doff %arvo %g %doff dude ship)
::
++ poke
|= [=mark =vase]

View File

@ -1659,7 +1659,7 @@
[%jolt =desk =dude] :: (re)start agent
[%idle =dude] :: suspend agent
[%nuke =dude] :: delete agent
[%doff ~] :: kill subscriptions
[%doff dude=(unit dude) ship=(unit ship)] :: kill subscriptions
$>(%init vane-task) :: set owner
$>(%trim vane-task) :: trim state
$>(%vega vane-task) :: report upgrade

View File

@ -432,12 +432,15 @@
:: +mo-doff: kill all outgoing subscriptions
::
++ mo-doff
|= [dude=(unit dude) ship=(unit ship)]
^+ mo-core
=/ apps ~(tap by yokes.state)
=/ apps=(list (pair term yoke))
?~ dude ~(tap by yokes.state)
(drop (bind (~(get by yokes.state) u.dude) (lead u.dude)))
|- ^+ mo-core
?~ apps mo-core
=/ ap-core (ap-yoke:ap:mo-core p.i.apps [~ our] q.i.apps)
$(apps t.apps, mo-core ap-abet:ap-doff:ap-core)
$(apps t.apps, mo-core ap-abet:(ap-doff:ap-core ship))
:: +mo-receive-core: receives an app core built by %ford.
::
:: Presuming we receive a good core, we first check to see if the agent
@ -1767,11 +1770,14 @@
:: request queue fix. This includes nonce 0, which no longer exists.
::
++ ap-doff
|= ship=(unit ship)
^+ ap-core
=/ subs ~(tap in ~(key by boat.yoke))
|- ^+ ap-core
?~ subs ap-core
=+ [wyr dok]=i.subs
?. |(?=(~ ship) =(u.ship ship.dok))
$(subs t.subs)
=/ let (~(got by boar.yoke) wyr dok)
|- ^+ ap-core
~> %slog.[0 leaf+"gall: +ap-doff {<[agent-name wyr dok let]>}"]
@ -1977,7 +1983,7 @@
%jolt mo-abet:(mo-jolt:mo-core dude.task our desk.task)
%idle mo-abet:(mo-idle:mo-core dude.task)
%nuke mo-abet:(mo-nuke:mo-core dude.task)
%doff mo-abet:mo-doff:mo-core
%doff mo-abet:(mo-doff:mo-core +.task)
%spew mo-abet:(mo-spew:mo-core veb.task)
%sift mo-abet:(mo-sift:mo-core dudes.task)
%trim [~ gall-payload]