pull-hook: do not crash on dangling sync

If the %kick handler of the inner-core crashes, then we never get to
resubscribe, thus leaving a dangling entry in the state with no
corresponding subscription. Updates the pull-hook-action pokes to not
crash when given a dangling entry.
This commit is contained in:
Liam Fitzgerald 2020-11-26 15:42:23 +10:00
parent 84694231ed
commit f851803d3c
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -304,33 +304,35 @@
=. tracking
(~(put by tracking) resource ship)
:_ state
~[(watch-resource resource /)]
(watch-resource resource /)
::
++ remove
|= =resource
:- ~[(leave-resource resource)]
:- (leave-resource resource)
state(tracking (~(del by tracking) resource))
--
::
++ leave-resource
|= rid=resource
^- card
=/ =ship
(~(got by tracking) rid)
^- (list card)
=/ ship=(unit ship)
(~(get by tracking) rid)
?~ ship ~
=/ =wire
(make-wire pull+resource+(en-path:resource rid))
[%pass wire %agent [ship push-hook-name.config] %leave ~]
[%pass wire %agent [u.ship push-hook-name.config] %leave ~]~
++ watch-resource
|= [rid=resource pax=path]
^- card
=/ =ship
(~(got by tracking) rid)
^- (list card)
=/ ship=(unit ship)
(~(get by tracking) rid)
?~ ship ~
=/ =path
(welp resource+(en-path:resource rid) pax)
=/ =wire
(make-wire pull+path)
[%pass wire %agent [ship push-hook-name.config] %watch path]
[%pass wire %agent [u.ship push-hook-name.config] %watch path]~
::
++ make-wire
|= =wire