From 18701b2ad236faa37389189b4dbb836c0fdfdf26 Mon Sep 17 00:00:00 2001 From: Fang Date: Tue, 28 Sep 2021 00:57:38 +0400 Subject: [PATCH] kiln: always check local desk when adjusting dudes We do not care about what's on foreign, the local desk is the thing we're taking action on. This is more robust in the face of absent information about foreign desks etc. Also stops pretending to take-commet during take-merge-main. We'll get a separate commit event. --- pkg/arvo/lib/hood/kiln.hoon | 7 +++---- pkg/base-dev/sur/hood.hoon | 13 +++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/pkg/arvo/lib/hood/kiln.hoon b/pkg/arvo/lib/hood/kiln.hoon index b2e938527..ae87b3e60 100644 --- a/pkg/arvo/lib/hood/kiln.hoon +++ b/pkg/arvo/lib/hood/kiln.hoon @@ -747,7 +747,7 @@ =? vats liv.rein.rak %- stop-dudes =< idle - (adjust-dudes [our loc now] `[ship desk aeon]:ral rein.rak) + (adjust-dudes [our loc now] rein.rak) =. rail.rak `%*(. ral aeon +(aeon:ral)) |^ ^+ vats ?: =(%base loc) @@ -851,7 +851,7 @@ %- (slog leaf/- p.p.syn) =. vats (emit (diff:give %merge-fail loc rak p.p.syn)) vats - =. vats take-commit + ~> %slog.(fmt "merge into {} succeeded") ?. =(%base loc) vats ~> %slog.(fmt "merging %base into %kids at {}") @@ -895,8 +895,7 @@ ++ update-running-dudes ^+ vats =/ local [our loc now] - =/ upstream ?~(rail.rak ~ `[ship desk aeon]:u.rail.rak) - =/ dif (adjust-dudes local upstream rein.rak) + =/ dif (adjust-dudes local rein.rak) =. vats (start-dudes jolt.dif) =. vats (stop-dudes idle.dif) vats diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index f317b4d59..9b48a60db 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -130,12 +130,14 @@ ++ read-bill-foreign |= [=ship =desk =aeon] ^- (list dude) + ~| +< =/ her (scot %p ship) =/ syd (scot %tas desk) =/ yon (scot %ud aeon) :: =/ dom .^(dome cv/~[her syd yon]) - =/ tak (scot %uv (~(got by hit.dom) aeon)) + =/ tak ~| aeons=~(key by hit.dom) + (scot %uv (~(got by hit.dom) aeon)) =/ yak .^(yaki cs/~[her syd yon %yaki tak]) =/ fil (~(get by q.yak) /desk/bill) ?~ fil ~ @@ -150,7 +152,7 @@ :: +read-bill: read contents of /desk/bill manifest :: ++ read-bill - |= [our=ship =desk now=@da] + |= [our=ship =desk now=@da] =/ pax (en-beam [our desk da+now] /desk/bill) ?. (~(has in .^((set ^desk) cd/~[(scot %p our) ~ (scot %da now)])) desk) *(list dude) @@ -165,16 +167,11 @@ :: ++ adjust-dudes |= $: local=[our=ship =desk now=@da] - upstream=(unit [=ship =desk =aeon]) =rein == ^- [jolt=(list dude) idle=(list dude)] =/ all=(list dude) - ?~ upstream - (read-bill local) - ?: =(ship.u.upstream our.local) - (read-bill local(desk desk.u.upstream)) - (read-bill-foreign u.upstream) + (read-bill local) =/ want (get-apps-want all rein) =/ have (get-apps-live local) [want (skip have ~(has in (sy want)))]