mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 00:13:12 +03:00
strandio: fail when http request gets cancelled
Instead of waiting for a proper response. Iris doesn't currently retry! Also updates docket to detect this case and retry appropriately.
This commit is contained in:
parent
6d1636b566
commit
526e60b04c
@ -332,6 +332,7 @@
|
||||
::
|
||||
:: TODO: We should gracefully retry on restart instead of just sending a
|
||||
:: cancel.
|
||||
:: TODO we might not want to do that though!
|
||||
::
|
||||
=/ moves=(list move)
|
||||
%+ turn ~(tap by connection-by-duct.state.ax)
|
||||
|
@ -386,6 +386,14 @@
|
||||
|= tin=strand-input:strand
|
||||
?+ in.tin `[%skip ~]
|
||||
~ `[%wait ~]
|
||||
::
|
||||
[~ %sign [%request ~] %iris %http-response %cancel *]
|
||||
::NOTE iris does not (yet?) retry after cancel, so it means failure
|
||||
:- ~
|
||||
:+ %fail
|
||||
%http-request-cancelled
|
||||
['http request was cancelled by the runtime']~
|
||||
::
|
||||
[~ %sign [%request ~] %iris %http-response %finished *]
|
||||
`[%done client-response.sign-arvo.u.in.tin]
|
||||
==
|
||||
|
@ -292,7 +292,7 @@
|
||||
?+ p.cage.sign `state
|
||||
%thread-fail
|
||||
=+ !<([=term =tang] q.cage.sign)
|
||||
?. =(term %cancelled)
|
||||
?. |(=(term %cancelled) =(term %http-request-cancelled))
|
||||
=. charges (new-chad:cha hung+'glob-failed')
|
||||
:- ~[add-fact:cha]
|
||||
((slog leaf+"docket: thread failed;" leaf+<term> tang) state)
|
||||
|
Loading…
Reference in New Issue
Block a user