[ImageExport] Synchronous invokation deadlock still occures
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- fsharp
- Domaine
- data-visualization, desktop
Piste de recherche
Commencez par le chemin synchrone de ImageExport, en particulier page.CloseAsync() et AsyncHelper.taskSyncUnit, et comparez-le avec le chemin fonctionnel ToBase64PNGStringAsync(). Reproduisez le problème à l’aide du gestionnaire de bouton Avalonia présenté dans le rapport ; c’est terminé lorsque chart.ToBase64PNGString() se termine et que l’exception suivante est atteinte.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Problem
This is the problem that we intended to fix with PR #321. It is fixed partially.
After we migrated to tasks instead of F#'s async, plus we changed
- page.CloseAsync() |> Async.AwaitTask |> Async.RunSynchronously
+ page.CloseAsync() |> AsyncHelper.taskSyncUnit
The async version works, as in, completes. However, the synchronous version still does not terminate
Reproduction
I'm going to present the repro with AvaloniaUI, but it should be as well reproduced in WinForms or WPF if you're on Windows.
1. Install templates & create project:
dotnet new --install Avalonia.Templates
dotnet new avalonia.mvvm -o TestAsync -n TestAsync
cd TestAsync/
2. Install the package
Add source & install the latest
dotnet new nugetconfig
dotnet nuget add source https://www.myget.org/F/plotly-net-nightly/api/v3/index.json
dotnet add package Plotly.NET.ImageExport --prerelease
3. Adding a component
Go to MainWindow.axaml and replace some default thingy with a button
- <TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+ <Button Click="Button_OnClick" />
4. Adding event
Go to MainWindow.axaml.cs and add this method:
private async void Button_OnClick(object? sender, RoutedEventArgs e)
{
var layout = new Layout();
var trace = new Trace("bar");
var fig = GenericChart.Figure.create(ListModule.OfSeq(new[] { trace }), layout);
var chart = GenericChart.fromFigure(fig);
// This works now
await chart.ToBase64PNGStringAsync();
// This never terminates
chart.ToBase64PNGString();
// If we get to this line, it terminated
throw new Exception();
}
5. Run
dotnet run
Now, once it started, click the button. Successful completion is when the exception occurs.
- Langage dominant
- F#
- Étoiles
- 860
- Forks
- 99
- Merge moyen
- 22 min
- PR mergées (30 j)
- 1
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de plotly/Plotly.NET
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
plotly/Plotly.NET#498 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 42/100
plotly/Plotly.NET#495 · 3 commentaires ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
plotly/Plotly.NET#494 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
plotly/Plotly.NET#492 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 38/100
plotly/Plotly.NET#485 · 1 commentaire ·
Toutes les issues de plotly/Plotly.NET
Issues similaires
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
BasedHardware/omi#15320 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
bancolombia/sentinel#23 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
AOSSIE-Org/OrgExplorer#245 ·
-
tech-debt
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
gordonwatts/test-wsl2-llm#151 ·