mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-24 23:44:56 +03:00
ford: ignore spurious clay responses
Due to asynchronicity, Ford can receive responses from Clay to requests that it has already attempted to cancel. This removes some overzealous assertions that this wouldn't happen.
This commit is contained in:
parent
b6e32791d4
commit
7dc499d438
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7281dac601ba3126e36da8766b7ad0424f283f6472c40b322e6e784e19aba33c
|
||||
size 9651177
|
||||
oid sha256:df629686e06b0c56db132076439b03d095bb235fc1a77668022d110559d9b840
|
||||
size 9650987
|
||||
|
@ -838,7 +838,9 @@
|
||||
|* [tracker=(request-tracker) request=*]
|
||||
^- (list duct)
|
||||
::
|
||||
~(tap in waiting:(~(got by tracker) request))
|
||||
?~ val=(~(get by tracker) request)
|
||||
~
|
||||
~(tap in waiting.u.val)
|
||||
:: +put-request: associates a +duct with a request
|
||||
::
|
||||
++ put-request
|
||||
@ -6263,22 +6265,29 @@
|
||||
++ take-rebuilds
|
||||
^- [(list move) ford-state]
|
||||
::
|
||||
~| [%ford-take-rebuilds wire=wire duct=duct]
|
||||
?> ?=([@tas %wris *] sign)
|
||||
=* case-sign p.sign
|
||||
=* care-paths-sign q.sign
|
||||
=+ [ship desk date]=(raid:wired t.wire ~[%p %tas %da])
|
||||
=/ disc [ship desk]
|
||||
:: ignore spurious clay updates
|
||||
::
|
||||
:: Due to asynchronicity of Clay notifications, we might get a
|
||||
:: subscription update on an already-canceled duct. This is
|
||||
:: normal; no-op.
|
||||
::
|
||||
?~ duct-status=(~(get by ducts.state.ax) duct)
|
||||
[~ state.ax]
|
||||
::
|
||||
=/ =subscription
|
||||
~| [%ford-take-bad-clay-sub wire=wire duct=duct]
|
||||
=/ =duct-status (~(got by ducts.state.ax) duct)
|
||||
?> ?=(%live -.live.duct-status)
|
||||
?> ?=(^ last-sent.live.duct-status)
|
||||
?> ?=(^ subscription.u.last-sent.live.duct-status)
|
||||
u.subscription.u.last-sent.live.duct-status
|
||||
?> ?=(%live -.live.u.duct-status)
|
||||
(need subscription:(need last-sent.live.u.duct-status))
|
||||
::
|
||||
=/ ducts=(list ^duct)
|
||||
~| [%ford-take-missing-subscription subscription]
|
||||
:: sanity check; there must be at least one duct per subscription
|
||||
::
|
||||
=- ?<(=(~ -) -)
|
||||
(get-request-ducts pending-subscriptions.state.ax subscription)
|
||||
::
|
||||
=| moves=(list move)
|
||||
@ -6296,13 +6305,12 @@
|
||||
++ take-unblocks
|
||||
^- [(list move) ford-state]
|
||||
::
|
||||
~| [%ford-take-unblocks wire=wire duct=duct]
|
||||
?> ?=([@tas %writ *] sign)
|
||||
=* riot-sign p.sign
|
||||
:: scry-request: the +scry-request we had previously blocked on
|
||||
::
|
||||
=/ =scry-request
|
||||
~| [%ford-take-bad-scry-request wire=wire duct=duct]
|
||||
(need (path-to-scry-request t.wire))
|
||||
=/ =scry-request (need (path-to-scry-request t.wire))
|
||||
:: scry-result: parse a (unit cage) from :sign
|
||||
::
|
||||
:: If the result is `~`, the requested resource was not available.
|
||||
@ -6311,9 +6319,9 @@
|
||||
?~ riot-sign
|
||||
~
|
||||
`r.u.riot-sign
|
||||
:: if spurious Clay response, :ducts will be empty, causing no-op
|
||||
::
|
||||
=/ ducts=(list ^duct)
|
||||
~| [%ford-take-missing-scry-request scry-request]
|
||||
(get-request-ducts pending-scrys.state.ax scry-request)
|
||||
::
|
||||
=| moves=(list move)
|
||||
|
Loading…
Reference in New Issue
Block a user