Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error handling in SubtleCrypto workers #71693

Merged
merged 5 commits into from
Jul 7, 2022

Conversation

eerhardt
Copy link
Member

@eerhardt eerhardt commented Jul 6, 2022

Handle exceptions from SubtleCrypto by catching and logging exceptions coming from the crypto stack.

Reset web worker when a request fails.

Also, fix race conditions where the web worker can read its own response as part of the next request.

Contributes to #69740

Handle exceptions from SubtleCrypto by catching and logging exceptions coming from the crypto stack.

Reset web worker when a request fails.

Also, fix race conditions where the web worker can read its own response as part of the next request.

Contributes to dotnet#69740
@ghost
Copy link

ghost commented Jul 6, 2022

Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones
See info in area-owners.md if you want to be subscribed.

Issue Details

Handle exceptions from SubtleCrypto by catching and logging exceptions coming from the crypto stack.

Reset web worker when a request fails.

Also, fix race conditions where the web worker can read its own response as part of the next request.

Contributes to #69740

Author: eerhardt
Assignees: -
Labels:

area-System.Security

Milestone: -

@ghost ghost assigned eerhardt Jul 6, 2022
@eerhardt eerhardt added the arch-wasm WebAssembly architecture label Jul 6, 2022
@ghost
Copy link

ghost commented Jul 6, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Handle exceptions from SubtleCrypto by catching and logging exceptions coming from the crypto stack.

Reset web worker when a request fails.

Also, fix race conditions where the web worker can read its own response as part of the next request.

Contributes to #69740

Author: eerhardt
Assignees: eerhardt
Labels:

arch-wasm, area-System.Security

Milestone: -

Format the code
Fix args bug in setup_proxy_console
@radical
Copy link
Member

radical commented Jul 6, 2022

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@radical radical left a comment

Choose a reason for hiding this comment

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

We agreed, offline, to leave the debug messages as-is for now. LGTM 👍

@radical radical requested a review from lambdageek July 6, 2022 18:51
@radical radical requested a review from kg July 6, 2022 19:16
@bartonjs
Copy link
Member

bartonjs commented Jul 6, 2022

Generally seems OK; but I sort of skimmed the js parts.

@radical
Copy link
Member

radical commented Jul 6, 2022

WasmBuildTests failures are unrelated, and can be ignored.

@eerhardt
Copy link
Member Author

eerhardt commented Jul 6, 2022

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@radical
Copy link
Member

radical commented Jul 7, 2022

The wasm failures are unrelated to this PR.

for (; ;) {
const lock_state = Atomics.load(this.comm, this.LOCK_IDX);
if (lock_state !== this.LOCK_UNLOCKED)
continue;
Copy link
Member

Choose a reason for hiding this comment

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

This tight spin loop is unfortunate, but as this is all part of a large workaround for sync-over-async, I guess we have nothing better.

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately, we don't 😞

@eerhardt eerhardt merged commit a2990b5 into dotnet:main Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants