Skip to content

[browser][MT]Download phase stalling. #108253

Open

Description

Hello,

I'm looking into supporting my library BlazorWorker on .net9. I'm having some trouble initializing dotnet using the same code as in .net8. I run into a kind of deadlock-looking situation in the download phase after calling await dotnet.create();, basically this call never returns, and it seems that after all the downloads have finished, we are awaiting some promise, somewhere... forever. The call is here: https://github.com/Tewr/BlazorWorker/blob/4aca2b9b3f9322e930c9495c4334293408b4f2ab/src/BlazorWorker/BlazorWorker.js#L165

I have tracked down the issue to something that might be related to parallel downloads in the initialization phase (is this new?). If I fiddle around in these methods, setting breakpoints and stuff, occasionally but sporadically the initialization phase will succeed. I have tried changing the maxParallelDownloads value to something lower but with limited success. So it's clearly some kind of sync problem. But in general, the slower the code is executing, the higher the chance of success, I think.

Maybe if I could get a better understanding of this parallel download mechanism I can find a way around this deadlock-looking situation? I have seen that there have been some multithreading work as well, so possible some kind of detection of me being inside a worker that may mess things up.

@pavelsavara has commited the code and has had some small interaction with my library in the past. I'd be happy for any insights. I'm particularly looking at this method start_asset_download_with_throttle. I'm note sure if it's the right spot, but I feel like it's around here somewhere where the hangup occurs.

async function start_asset_download_with_throttle (asset: AssetEntryInternal): Promise<AssetEntryInternal> {
.

Original issue, with code to reproduce the problem
Tewr/BlazorWorker#111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

  • Status

    No status

Relationships

None yet

Development

No branches or pull requests

Issue actions