Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

[browser][MT] Make ChangeLocalTimeZone thread-safe - #103953

Closed
mkhamoyan wants to merge 1 commit into
dotnet:mainfrom
mkhamoyan:time_zone_test_thread_safe
Closed

mkhamoyan wants to merge 1 commit into
dotnet:mainfrom
mkhamoyan:time_zone_test_thread_safe

Conversation

@mkhamoyan

Copy link
Copy Markdown
Contributor

Fixes #101166

@ghost ghost added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 25, 2024
@mkhamoyan mkhamoyan self-assigned this Jun 25, 2024
@mkhamoyan mkhamoyan added os-browser Browser variant of arch-wasm arch-wasm WebAssembly architecture and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jun 25, 2024
@mkhamoyan
mkhamoyan marked this pull request as ready for review June 25, 2024 12:00
@ilonatommy

Copy link
Copy Markdown
Member

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@ilonatommy ilonatommy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locally I cannot reproduce running in the loop.

@pavelsavara pavelsavara left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is just hiding real underlying issue with emscripten.

It is posting async messages to UI thread from whatever thread exeuted the TZ change. And those messages probably come in random order.

Let's reconsider.

@mkhamoyan
mkhamoyan marked this pull request as draft June 26, 2024 07:52
@pavelsavara
pavelsavara requested a review from ilonatommy July 3, 2024 12:51
@pavelsavara

Copy link
Copy Markdown
Member

Let's revert this change, because it effectively hides the problem from the test.

Let's rather create additional test which will change TZ from many different threads in threadpool.
And observe the overall impact.
What would be expected behavior on Windows ?

@ilonatommy

ilonatommy commented Jul 3, 2024 •

Copy link
Copy Markdown
Member

What would be expected behavior on Windows ?

well, change on windows has an effect in the whole system, including registries, so if we do it concurrently I would assume a race and undefined expected result

@pavelsavara

Copy link
Copy Markdown
Member

well, change on windows has an effect in the whole system, including registries, so if we do it concurrently I would assume a race and undefined expected result

You are right, my bad. We should not try to make it work in parallel from multiple threads.

We need to catch one (non-UI) thread doing it and the change being propagated too slowly. So that we can understand how it works in emscripten and what we need to synchronize in Mono. To prevent this "read after write hazard" or whatever it is.

@ilonatommy

Copy link
Copy Markdown
Member

We need to catch one (non-UI) thread doing it

Do I understand it right that we drop the concept of improving test, revert the lock changes and now the goal is to pin debugger and investigate what is the reason for the failure? This failure was hit once per few weeks, any suggestions how to increase the probability of reproduction?

@pavelsavara

Copy link
Copy Markdown
Member

Do I understand it right that we drop the concept of improving test, revert the lock changes

I think so. Current code is how people write TZ code and it's broken only on MT WASM.

now the goal is to pin debugger and investigate what is the reason for the failure?

Yes, I don't expect that you would be able to use debugger.

This failure was hit once per few weeks, any suggestions how to increase the probability of reproduction?

Run it in a loop 1000 times.

@mkhamoyan

Copy link
Copy Markdown
Contributor Author

Thanks @pavel and @ilonatommy for clarification.
I left comment under the issue per this discussion and will close this PR.

@mkhamoyan mkhamoyan closed this Jul 3, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[browser][MT] TimeZoneInfoTests.ChangeLocalTimeZone not thread safe

3 participants