[ImageExport] Synchronous invokation deadlock still occures
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- fsharp
- Lĩnh vực
- data-visualization, desktop
Hướng nghiên cứu
Bắt đầu với đường dẫn đồng bộ của ImageExport, đặc biệt là page.CloseAsync() và AsyncHelper.taskSyncUnit, rồi so sánh với đường dẫn ToBase64PNGStringAsync() đang hoạt động. Tái hiện sự cố bằng trình xử lý nút Avalonia được hiển thị trong báo cáo; hoàn tất khi chart.ToBase64PNGString() kết thúc và gặp ngoại lệ sau.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- F#
- Star
- 860
- Fork
- 99
- Merge trung bình
- 22 phút
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của plotly/Plotly.NET
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
plotly/Plotly.NET#498 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
plotly/Plotly.NET#495 · 3 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
plotly/Plotly.NET#494 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
plotly/Plotly.NET#492 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
plotly/Plotly.NET#485 · 1 bình luận ·
Tất cả issue của plotly/Plotly.NET
Issue tương tự
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
BasedHardware/omi#15320 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
bancolombia/sentinel#23 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AOSSIE-Org/OrgExplorer#245 ·
-
tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
gordonwatts/test-wsl2-llm#151 ·