mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 16:51:42 +03:00
clay: properly resume work when +retry-with-ames
Previously, when the scry timeout fired and we retried the request with ames, we would always start over from the very first request (ie, fetching the ""manifest"" containing the files we need to download). This behavior is not correct in the case where we had already received that initial response, and were now fetching individual files. So here, if that's the case, we simply call into +work after marking this peer as having known-broken scry, which will resume work as appropriate. (The actual bug here that broke the fallback behavior entirely was the busy flag not getting unset. We now clean it up properly.) We also move setting of the sad timer into +retry-with-ames, instead of doing it at each individual callsite. (In fact, one of the callsites was missing this behavior.)
This commit is contained in:
parent
9e3bcf14c1
commit
4848d58410
@ -3083,11 +3083,14 @@
|
||||
~| [%strange-retry-no-request her syd inx]
|
||||
?> ?=(^ ref)
|
||||
=/ sat=update-state (~(got by bom.u.ref) inx)
|
||||
:: mark her as having broken scry comms
|
||||
::
|
||||
=. sad (~(put by sad) her now)
|
||||
:: clean up scry request & timer
|
||||
::
|
||||
=. ..retry-with-ames
|
||||
=< ?>(?=(^ ref) .)
|
||||
~| [%strange-retry-not-scry her syd inx scry.sat -.rave]
|
||||
~| [%strange-retry-not-scry her syd inx scry.sat -.rave.sat]
|
||||
?> ?=(^ scry.sat)
|
||||
?> ?=(%sing -.rave.sat)
|
||||
=/ =wire (request-wire kind her syd inx)
|
||||
@ -3100,11 +3103,10 @@
|
||||
==
|
||||
:: re-send over ames
|
||||
::
|
||||
=. ..retry-with-ames
|
||||
=< ?>(?=(^ ref) .)
|
||||
=. bom.u.ref (~(put by bom.u.ref) inx sat(scry ~, busy |))
|
||||
?: =(%warp-index kind)
|
||||
(send-over-ames hen her inx syd `rave.sat)
|
||||
=. bom.u.ref (~(put by bom.u.ref) inx sat(scry ~))
|
||||
..retry-with-ames
|
||||
abet:work:(foreign-update inx)
|
||||
::
|
||||
:: Called when a foreign ship answers one of our requests.
|
||||
::
|
||||
@ -5249,7 +5251,6 @@
|
||||
=/ index=@ud (slav %ud i.t.t.t.tea)
|
||||
~& [%clay %scry-broken her]
|
||||
=^ mos ruf
|
||||
=. sad.ruf (~(put by sad.ruf) her now)
|
||||
=/ den ((de now rof hen ruf) her desk)
|
||||
abet:(retry-with-ames:den %warp-index index)
|
||||
[mos ..^$]
|
||||
@ -5294,7 +5295,6 @@
|
||||
=/ =desk (slav %tas i.t.t.tea)
|
||||
=/ index=@ud (slav %ud i.t.t.t.tea)
|
||||
=^ mos ruf
|
||||
=. sad.ruf (~(put by sad.ruf) her now)
|
||||
=/ den ((de now rof hen ruf) her desk)
|
||||
abet:(retry-with-ames:den %back-index index)
|
||||
[mos ..^$]
|
||||
|
Loading…
Reference in New Issue
Block a user