[ImageExport] Synchronous invokation deadlock still occures
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- fsharp
- Domínio
- data-visualization, desktop
Direção de pesquisa
Comece pelo caminho síncrono de ImageExport, especialmente page.CloseAsync() e AsyncHelper.taskSyncUnit, e compare-o com o caminho funcional ToBase64PNGStringAsync(). Reproduza o problema usando o manipulador do botão Avalonia mostrado no relatório; está concluído quando chart.ToBase64PNGString() termina e a exceção a seguir é atingida.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- F#
- Estrelas
- 860
- Forks
- 99
- Merge médio
- 22min
- PRs com merge (30d)
- 1
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de plotly/Plotly.NET
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
plotly/Plotly.NET#498 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 42/100
plotly/Plotly.NET#495 · 3 comentários ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 45/100
plotly/Plotly.NET#494 · 1 comentário ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
plotly/Plotly.NET#492 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 38/100
plotly/Plotly.NET#485 · 1 comentário ·
Todas as issues de plotly/Plotly.NET
Issues semelhantes
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
BasedHardware/omi#15320 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
bancolombia/sentinel#23 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
AOSSIE-Org/OrgExplorer#245 ·
-
tech-debt
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
gordonwatts/test-wsl2-llm#151 ·