Skip to content

Potential issue with synchronous invokation #306

Closed

Description

@WhiteBlackGoose

I haven't reproduced it yet, so it's rather not to forget to test it.

Take this C# code:

await Microsoft.FSharp.Control.FSharpAsync.StartAsTask(GenericChart.fromFigure(fig).ToBase64PNGStringAsync())l

There's a suspection that it either deadlocks or some other issues on borders between F#'s async and C#'s tasks.

Edit:

Chart.Line([1., 1.; 2., 3.; 3., 3])
|> Chart.toBase64PNGStringAsync()
|> Async.RunSynchronously
|> printf "%s"

never terminates

Activity

  1. WhiteBlackGoose commented on Jul 1, 2022

    @WhiteBlackGoose
    ContributorAuthor

    fixed

  2. WhiteBlackGoose commented on Jul 5, 2022

    @WhiteBlackGoose
    ContributorAuthor

    Yep. here

    We shouldn't do that

  3. WhiteBlackGoose commented on Jul 8, 2022

    @WhiteBlackGoose
    ContributorAuthor

    So the solution here is either not to use Puppeteer Sharp, or

    1. Remember the current sync ctx
    2. Set it to null
    3. Do stuff, including .Result
    4. Restore the ctx
  4. added a commit that references this issue on Jul 9, 2022
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