You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last time such an error was observed was in 2022. I may have accidentally fixed it at some point (see possible causes). Perhaps we should close the issue.
Reproduction
???
Possible causes {#posible-causes}
This can happen because of an exception in MailboxProccessor: when .PostAndReply is called, it waits for a response. If an exception occurs in MailboxProccessor before that, .PostAndReply will continue to wait indefinitely.
The following code can be used to prove this:
moduleAsyncLearning =openSystem.Threading.Tasksletawaiti(t:Task)=
t.GetAwaiter().GetResult()typeMsg=| Inc ofAsyncReplyChannel<int>| GetCounter ofAsyncReplyChannel<int>letreduce msg state =match msg with| Inc ->letcounter= state +1if counter >1then
System.Threading.Tasks.Task.Run(fun x ->
failwithf "counter > 1")|> awaiti
counter
| GetCounter r ->
r.Reply state
state
letcounter=letinitState=0
MailboxProcessor.Start(fun mail ->let recloop state =async{let!msg= mail.Receive()letstate=try
reduce msg state
with e ->
printfn "%A" e
state
return! loop state
}
loop initState
)
counter.PostAndReply (fun r -> Inc r)()
The text was updated successfully, but these errors were encountered:
Last seen
The last time such an error was observed was in 2022. I may have accidentally fixed it at some point (see possible causes). Perhaps we should close the issue.
Reproduction
???
Possible causes {#posible-causes}
This can happen because of an exception in
MailboxProccessor
: when.PostAndReply
is called, it waits for a response. If an exception occurs inMailboxProccessor
before that,.PostAndReply
will continue to wait indefinitely.The following code can be used to prove this:
The text was updated successfully, but these errors were encountered: