Sitelet https://github.com/fsprojects/Paket/issues/2639
Skip to content

Restore Failure on Mono: System.Exception: Expected an result at this place. #2639

Description

@0x53A

I've been skimming through the travis logs and found one error that looked ... interesting:

image

https://travis-ci.org/fsprojects/Paket/jobs/266475236#L1953

It comes from this line:

let internal memoizeAsyncEx (f: 'iext -> 'i -> Async<'o * 'oext>) =
let cache = System.Collections.Concurrent.ConcurrentDictionary<'i, System.Threading.Tasks.Task<'o>>()
let handle (ex:'iext) (x:'i) : Choice<System.Threading.Tasks.Task<'o>, Async<'o * 'oext>> =
//fun (ex:'iext) (x: 'i) -> // task.Result serialization to sync after done.
let mutable result = None
let mutable wasAdded = false
let task = cache.GetOrAdd(x, fun x ->
wasAdded <- true
async {
let! o, oext = f ex x
result <- Some oext
return o
} |> Async.StartAsTask) // |> Async.AwaitTask
if not wasAdded then
Choice1Of2 task
else
async {
let! res = task |> Async.AwaitTask
match result with
| Some ext -> return res, ext
| None -> return failwithf "Expected an result at this place."

Just judging from the context, it seems like this should not happen and represents either a mono async issue, or an actual bug. But I haven't analyzed it in any way.

If you don't care about this, just close the issue ;-)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions