%lost ames gift and stub handlers in vanes

This commit is contained in:
Ted Blackman 2019-08-27 20:12:56 -07:00
parent 33ebf6c1a5
commit ca00d89286
5 changed files with 55 additions and 28 deletions

View File

@ -1773,16 +1773,25 @@
:: could change this to a no-op if we had some sort of security
:: reporting.
::
:: TODO: This handles a previous crash in the client vane, but not in
:: Ames itself.
::
++ on-still-boon
|= [=message-num message=*]
^+ peer-core
~> %slog.0^leaf/"ames: boon {<her.channel^bone>}"
:: send ack unconditionally
::
=. peer-core (run-message-still bone %done ok=%.y)
:: give message to client vane
::
(emit (got-duct bone) %give %boon message)
?. ?=([%hear * * ok=%.n] task)
:: fresh boon; give message to client vane
::
~> %slog.0^leaf/"ames: boon {<her.channel^bone>}"
(emit (got-duct bone) %give %boon message)
:: we previously crashed on this message; notify client vane
::
~> %slog.1^leaf/"ames: crashed on boon {<her.channel^bone>}"
(emit (got-duct bone) %give %lost ~)
:: +on-still-nack-trace: handle nack-trace received by |message-still
::
++ on-still-nack-trace

View File

@ -508,8 +508,9 @@
$% [%init-clad ~] ::
== == ::
$: %a :: by %ames
$> $? %boon ::
%done ::
$> $? %boon :: response
%done :: (n)ack
%lost :: lost boon
== ::
gift:able:ames ::
== ::
@ -4478,7 +4479,8 @@
== ==
::
?: ?=([%warp-index @ @ @ ~] tea)
?: ?=(%done +<.q.hin)
?+ +<.q.hin ~| %clay-warp-index-strange !!
%done
?~ error.q.hin
[~ ..^$]
:: TODO better error handling
@ -4487,23 +4489,23 @@
%- (slog tang.u.error.q.hin)
[~ ..^$]
::
?> ?=(%boon +<.q.hin)
::
=/ res=(unit rand)
?^ v=((soft ,(unit rand)) payload.q.hin)
u.v
~| %clay-take-boon-fail^our^payload.q.hin
%lost
~| %clay-take-lost^our
:: TODO better error handling
!!
::=+ ;; res=(unit rand) payload.q.hin
::
=/ her=ship (slav %p i.t.tea)
=/ =desk (slav %tas i.t.t.tea)
=/ index=@ud (slav %ud i.t.t.t.tea)
::
=^ mos ruf
=/ den ((de our now ski hen ruf) her desk)
abet:(take-foreign-answer:den index res)
[mos ..^$]
%boon
=+ ;; res=(unit rand) payload.q.hin
::
=/ her=ship (slav %p i.t.tea)
=/ =desk (slav %tas i.t.t.tea)
=/ index=@ud (slav %ud i.t.t.t.tea)
::
=^ mos ruf
=/ den ((de our now ski hen ruf) her desk)
abet:(take-foreign-answer:den index res)
[mos ..^$]
==
::
?: ?=([%sinks ~] tea)
?> ?=(%public-keys +<.q.hin)
@ -4603,6 +4605,7 @@
:: handled in the wire dispatcher
::
%boon !!
%lost !!
%writ !!
::
%done

View File

@ -393,9 +393,12 @@
?: ?=([%a %done *] sih)
(mo-awed him cub error.sih)
::
?> ?=([%a %boon *] sih)
=+ mes=;;([@ud roon] payload.sih)
(mo-gawd:(mo-abed:mo hen) him dap mes)
?: ?=([%a %boon *] sih)
=+ mes=;;([@ud roon] payload.sih)
(mo-gawd:(mo-abed:mo hen) him dap %& mes)
::
?> ?=([%a %lost *] sih)
(mo-gawd:(mo-abed:mo hen) him dap %| [%leaf "ames: lost boon"]~)
==
::
++ mo-cook :: take in /use
@ -497,13 +500,16 @@
==
::
++ mo-gawd :: ames backward
|= {him/@p dap/dude num/@ud ron/roon}
?- -.ron
|= {him/@p dap/dude ron/(each [num=@ud =roon] tang)}
::
?: ?=(%| -.ron)
(mo-give %unto %quit ~)
?- -.roon.p.ron
$x (mo-give %unto %quit ~)
$d
%+ mo-pass
[%sys %rep (scot %p him) dap (scot %ud num) ~]
[%f %build live=%.n [%vale [p q]:(mo-beak dap) p.ron q.ron]]
[%sys %rep (scot %p him) dap (scot %ud num.p.ron) ~]
[%f %build live=%.n [%vale [p q]:(mo-beak dap) [p q]:roon.p.ron]]
==
::
++ ap :: agent engine

View File

@ -94,6 +94,7 @@
$% $: %a
$% $>(%boon gift:able:ames) :: message response
$>(%done gift:able:ames) :: message (n)ack
$>(%lost gift:able:ames) :: lost boon
== ==
$: %g ::
$> $? %onto ::
@ -522,6 +523,12 @@
=+ ;; [%public-keys-result =public-keys-result] payload.hin
%- curd =< abet
(public-keys:~(feel su hen our pki etn) public-keys-result)
::
[%a %lost *]
:: TODO: better error handling
::
~| %jael-ames-lost
!!
::
[%g %onto *]
~& [%jael-onto tea hin]

View File

@ -400,6 +400,7 @@
::
:: %boon: response message from remote ship
:: %done: notify vane that peer (n)acked our message
:: %lost: notify vane that we crashed on %boon
:: %send: packet to unix
::
:: %mass: memory usage report
@ -408,6 +409,7 @@
+$ gift
$% [%boon payload=*]
[%done error=(unit error)]
[%lost ~]
[%send =lane =blob]
::
[%mass p=mass]