Skip to content

Storage: fix the cmdlets hang in event issue #3299

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

Merged
merged 1 commit into from
Jan 5, 2017
Merged

Conversation

blueww
Copy link
Member

@blueww blueww commented Dec 16, 2016

Description

The PR fixed 1 issues:

Call some storage cmdlets from event will hang. To fix the issue add ConfigureAwait(false) for all aycn call. (https://msdn.microsoft.com/en-us/library/system.threading.tasks.task.configureawait%28v=vs.110%29.aspx)
We have verified the cmdlets won't hang in WPF or WinForm event now. and it also work well when call from Console.
Issue Link : #3205

This is a safe change since:
This is a Best Practices in Asynchronous Programming https://msdn.microsoft.com/en-us/magazine/jj991977.aspx , the exception is “Methods that require context”
For the storage cmdlets that use Async call, I have checked they are all Azure Server request or DMlib transfer job, which don’t require context. So it’s safe to add ConfigureAwait(false) to avoid the hang.
And as PowerShell is not GUI program, it’s even safe to add ConfigureAwait(false).

Test:
Storage team regression and On Demand test both pass with the code change:
http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-demand/1360/

This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.

  • [ Y] I have read the contribution guidelines.
  • [ Y] If changes were made to any cmdlet, the XML help was regenerated using the platyPSHelp module. - No change to interface, so no help change
  • [ Y] If any large changes are made to a service, they are reflected in the respective change log. -No large change

General Guidelines

  • [ Y] Title of the pull request is clear and informative.
  • [Y ] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.
  • [Y ] The pull request does not introduce breaking changes (unless a major version change occurs in the assembly and module).

Testing Guidelines

  • [Y ] Pull request includes test coverage for the included changes.
  • [Y] PowerShell scripts used in tests should do any necessary setup as part of the test or suite setup, and should not use hard-coded values for locations or existing resources.

Cmdlet Signature Guidelines - no cmdlet change

  • [N/A ] New cmdlets that make changes or have side effects should implement ShouldProcess and have SupportShouldProcess=true specified in the cmdlet attribute. You can find more information on ShouldProcess here.
  • [N/A ] Cmdlet specifies OutputType attribute if any output is produced - if the cmdlet produces no output, it should implement a PassThrough parameter.

Cmdlet Parameter Guidelines - no cmdlets parameter change

  • [N/A ] Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
  • [N/A ] Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
  • [N/A ] Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

@blueww blueww changed the title Storage: fix the cmdlets hang in event issue, and Start-AzureStorageBobCopy from Page blob URI return wrong blobtype issue Storage: fix the cmdlets hang in event issue Dec 28, 2016
@twitchax
Copy link
Contributor

twitchax commented Jan 3, 2017

Talked with @shahabhijeet offline, and it seems I misunderstood the root cause of the issue (I apologize).

@blueww, we are planning on taking this fix: would you prefer this release (code complete 2017/01/11) or the next release (code complete 2017/02/01)? Sorry for the randomization!

@blueww
Copy link
Member Author

blueww commented Jan 4, 2017

I would prefer this release (code complete 2017/01/11)
As all checks are green, let me know if any thing else need to merge the PR in.
Thanks!

@twitchax
Copy link
Contributor

twitchax commented Jan 4, 2017

I don't think there is anything else you need to do!

@shahabhijeet will take the PR after he reviews.

@twitchax twitchax requested a review from shahabhijeet January 4, 2017 11:29
@shahabhijeet
Copy link
Contributor

@blueww shouldn't we add any tests to avoid any regressions. I know you mentioned you tested it, but isn't there few tests that we can add?

@blueww
Copy link
Member Author

blueww commented Jan 5, 2017

Discussed with Abhijeet, as the storage data plane cmdlets (which changed in the PR) are based on XSCL (Storage Client library), and XSCL don't support record and replay mode test, so we can't covered the test of the cmdlets in the Powershell solution. Storage team has our own regression test, which have a full coverage of all cmdlets. And the storage team regression has passed with the PR, besides the on demand test. Abhijeet is OK with it.

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

Successfully merging this pull request may close these issues.

4 participants