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

Add Stream payload to ExecuteStoredProcedureStreamAsync #1061

Merged
merged 12 commits into from
Dec 12, 2019
Merged

Add Stream payload to ExecuteStoredProcedureStreamAsync #1061

merged 12 commits into from
Dec 12, 2019

Conversation

joshlang
Copy link
Contributor

Description

#1059

This adds an overload to ExecuteStoredProcedureStreamAsync which accepts a Stream payload representing the parameters. The original only accepted dynamic[], which must be serialized.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Closing issues

closes #1059

@joshlang joshlang marked this pull request as ready for review November 27, 2019 20:17
@j82w
Copy link
Contributor

j82w commented Nov 27, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

j82w
j82w previously approved these changes Nov 27, 2019
@joshlang
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 1061 in repo Azure/azure-cosmos-dotnet-v3

@joshlang
Copy link
Contributor Author

Worth a shot :D

@j82w
Copy link
Contributor

j82w commented Nov 28, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@joshlang
Copy link
Contributor Author

Wow, you guys have quite the test suite. I've updated my local environment so that I can actually run them all. Previously, most failed so I just ignored failures.

FYI Microsoft.Azure.Cosmos.Tests -> AsyncCacheTest -> TestCancelOnOneThreadCancelsOtherTaskIfCanceled still fails for me.

@joshlang
Copy link
Contributor Author

Unrelated to this PR - just a question:

This assertion is what fails the test when I run it locally.

The assertion doesn't seem to make sense - it's a race condition at best. After the cancellationTokenSource is .Cancel()'ed, getTask1 can complete at any time, including immediately.

What's your approach to stuff like this? Leave it alone unless it's actually causing trouble in the pipeline? Raise an issue and let the test owner fix it? Hope for a PR lol?

@j82w
Copy link
Contributor

j82w commented Nov 28, 2019

Create an issue for the failing test. Someone will investigate it. It probably won't be until next week. What's interesting is the test seems to be passing in the gates. Please make sure to put the OS you are running.

@j82w
Copy link
Contributor

j82w commented Nov 28, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@joshlang
Copy link
Contributor Author

Test failed due to ...Class Initialization method Microsoft.Azure.Cosmos.SDK.EmulatorTests.BatchSinglePartitionKeyTests.ClassInitialize threw exception. Microsoft.Azure.Cosmos.CosmosException: Microsoft.Azure.Cosmos.CosmosException: Response status code does not indicate success: 408 Substatus: 0 Reason: (Microsoft.Azure.Documents.RequestTimeoutException...

Probably transient.

@joshlang
Copy link
Contributor Author

Could I get a friendly neighborhood /azp run por favor?

@j82w
Copy link
Contributor

j82w commented Dec 2, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kirankumarkolli
Copy link
Member

#1059 updated with more context and follow-up.

@joshlang
Copy link
Contributor Author

joshlang commented Dec 3, 2019

changelog.md conflicts are now resolved.

kirankumarkolli
kirankumarkolli previously approved these changes Dec 5, 2019
@kirankumarkolli
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kirankumarkolli
Copy link
Member

@ealsur can you please take a look a the tests and any new coverage needed?

@joshlang
Copy link
Contributor Author

joshlang commented Dec 5, 2019

Failing test - probably transient:

X TestReducePageSizeScenario [393ms]
  Error Message:
   Initialization method Microsoft.Azure.Cosmos.SDK.EmulatorTests.ChangeFeed.DynamicTests.TestInitialize threw exception. Microsoft.Azure.Cosmos.CosmosException: Response status code does not indicate success: 500 Substatus: 0 Reason: (Microsoft.Azure.Documents.DocumentClientException: Message: {"Errors":["An unknown error occurred while processing this request."]}
...

…: Unparseable json, not-an-object, "null" literal, and array-like objects
@ealsur
Copy link
Member

ealsur commented Dec 11, 2019

/asp run

@joshlang
Copy link
Contributor Author

/asp run

azp? :D

@ealsur
Copy link
Member

ealsur commented Dec 11, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@ealsur
Copy link
Member

ealsur commented Dec 11, 2019

There seems to be a build error from the merge with master. ScriptsInlineCore needs to implement the new public method, it should be similar to the other Execute where TaskHelper is used to wrap the inner call (ref #1078)

@joshlang
Copy link
Contributor Author

You silly goose, why do you update master behind my back :D

Ok, will investigate.

@ealsur
Copy link
Member

ealsur commented Dec 11, 2019

Sorry! It should be as simple as:

public override Task<ResponseMessage> ExecuteStoredProcedureStreamAsync(
    string storedProcedureId,
    Stream streamPayload,
    PartitionKey partitionKey,
    StoredProcedureRequestOptions requestOptions = null,
    CancellationToken cancellationToken = default(CancellationToken));
{
    return TaskHelper.RunInlineIfNeededAsync(() => this.scripts.ExecuteStoredProcedureStreamAsync<TOutput>(storedProcedureId, streamPayload, partitionKey, requestOptions, cancellationToken));
}

@joshlang
Copy link
Contributor Author

No problem. Synced up from Azure/master, made the changes and should be good to go

@ealsur
Copy link
Member

ealsur commented Dec 11, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@joshlang
Copy link
Contributor Author

Various connectivity errors to nuget:

C:\Program Files\dotnet\sdk\3.1.100\NuGet.targets(123,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [D:\a\1\s\Microsoft.Azure.Cosmos.sln]


Failed to download package 'Microsoft.Azure.Cosmos.Serialization.HybridRow.1.0.0-preview' from 'https://www.myget.org/F/azure-cosmos/api/v3/flatcontainer/microsoft.azure.cosmos.serialization.hybridrow/1.0.0-preview/microsoft.azure.cosmos.serialization.hybridrow.1.0.0-preview.nupkg'.
         No connection could be made because the target machine actively refused it.

Either nuget has exploded permanently, or hopefully it's transient

@kirankumarkolli kirankumarkolli merged commit 6ca380b into Azure:master Dec 12, 2019
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.

ExecuteStoredProcedureStreamAsync is only half-Stream
4 participants