Http.fs icon indicating copy to clipboard operation
Http.fs copied to clipboard

Task can be cancelled on hibernate

Open haf opened this issue 6 years ago • 2 comments

One exception not caught:

System.Exception: Failed to get response ---> System.AggregateException: One or more errors occurred. (A task was canceled.) ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Hopac.Core.TaskToJobAwaiter`1.DoWork(Worker& wr)
   at Hopac.Core.Worker.RunOnThisThread(Scheduler sr, Work work)
   --- End of inner exception stack trace ---
   at HttpFs.Client.getResponseOrFail@953[a,b](FSharpChoice`2 _arg1)
   at Hopac.Core.ContMap`2.DoCont(Worker& wr, X x)
   at Hopac.Once`1.DoJob(Worker& wr, Cont`1 xK)
   at Hopac.Core.JobUsing`2.ContUsing.DoCont(Worker& wr, Y y)
   at Hopac.Core.JobUsing`2.ContUsing.DoCont(Worker& wr, Y y)
   at Hopac.Core.Worker.Run(Scheduler sr, Int32 me)

haf avatar Apr 15 '18 19:04 haf

@seanamos any hint of why is that happening?

This is the code 798 I assume is getting canceled because some other alternative is being committed.

@haf How can I reproduce this error? Or is it when running long-time requests?

ivpadim avatar Apr 27 '18 16:04 ivpadim

@ivpadim Some guesses: set up mitmproxy, set it to very slow, then call https://discourse.mitmproxy.org/t/killing-tcp-connections/775 flow.kill(); alternatively, you could call Suave with a Async.Sleep 1000 and directly cancelling the async token of the client.

haf avatar Apr 28 '18 15:04 haf