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

Fix 10 minutes time out of TransactionScope #21102

Merged
merged 1 commit into from
Sep 20, 2021

Conversation

wli3
Copy link

@wli3 wli3 commented Sep 17, 2021

@wli3
Copy link
Author

wli3 commented Sep 17, 2021

@dsplaisted could you have a look?

Comment on lines 105 to 106
SetTransactionManagerField("s_cachedMaxTimeout", true);
SetTransactionManagerField("s_maximumTimeout", timeout);
Copy link
Member

Choose a reason for hiding this comment

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

These are static fields, so it probably makes sense to just set them once rather than each time we create a transaction.

@wli3
Copy link
Author

wli3 commented Sep 17, 2021

@mconnew thanks for the suggestion! Please help me double check the fix

EnlistmentOptions.None);
using (var scope = new TransactionScope(
TransactionScopeOption.Required,
TimeSpan.Zero))
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure you want an infinite timeout? A really high timeout will still eventually timeout whereas something going wrong with an infinite timeout can cause things to block indefinitely.

Copy link
Member

Choose a reason for hiding this comment

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

I think that the other operations happening within the transaction have their own timeouts, so it wouldn't end up being effectively infinite.

@mattleibow
Copy link
Member

How does one test this PR? I can test locally here and make sure we got it :)

@dsplaisted
Copy link
Member

How does one test this PR? I can test locally here and make sure we got it :)

Build the repo locally, then run eng\dogfood.cmd to get into an environment which will use the just-built SDK. Then you can try doing a workload install for that.

See also https://github.com/dotnet/sdk/blob/main/documentation/project-docs/developer-guide.md#using-the-built-dotnet

@wli3
Copy link
Author

wli3 commented Sep 20, 2021

@mattleibow I tested it, it does work.

That's how I test, after running dogfood build, get an VPN (I used my home machine). Find the furthest node so the download would need more than 10 minutes. Run dotnet workload install maui. Without this change, the installation would fail in 10 minutes, with it, the installation will not fail.

@wli3
Copy link
Author

wli3 commented Sep 20, 2021

@mattleibow let me know when it is good. I do need to get this in soon.

@wli3
Copy link
Author

wli3 commented Sep 20, 2021

Talked to Matthew offline. This is good to merge for now

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

Successfully merging this pull request may close these issues.

4 participants