Skip to content

Potential issue with synchronous invokation #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
WhiteBlackGoose opened this issue Jul 1, 2022 · 3 comments · Fixed by #321
Closed

Potential issue with synchronous invokation #306

WhiteBlackGoose opened this issue Jul 1, 2022 · 3 comments · Fixed by #321

Comments

@WhiteBlackGoose
Copy link
Contributor

WhiteBlackGoose commented Jul 1, 2022

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

@WhiteBlackGoose
Copy link
Contributor Author

WhiteBlackGoose commented Jul 1, 2022

fixed

@WhiteBlackGoose
Copy link
Contributor Author

Yep. here

We shouldn't do that

@WhiteBlackGoose
Copy link
Contributor Author

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

WhiteBlackGoose added a commit to WhiteBlackGoose/Plotly.NET that referenced this issue Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant