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

implement passthrough middleware for entities #2572

Conversation

sebastianburckhardt
Copy link
Collaborator

With new core entity support, storage providers can now dispatch entity work items separately, and DT.Core processes them through in a separate dispatcher.

This PR updates the middleware passthrough to reflect this.

This PR depends on Azure/durabletask#953.

Pull request checklist

is targeting feature branch feature/core-entities.

@sebastianburckhardt sebastianburckhardt added core-entities required for entity support in isolated P1 Priority 1 labels Sep 7, 2023
{
functionResult = await functionInfo.Executor.TryExecuteAsync(
input,
cancellationToken: this.HostLifetimeService.OnStopping);
Copy link
Contributor

Choose a reason for hiding this comment

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

Add the following lines here:

if (!functionResult.Succeeded)
{
    // Shutdown can surface as a completed invocation in a failed state.
    // Re-throw so we can abort this invocation.
    this.HostLifetimeService.OnStopping.ThrowIfCancellationRequested();
}


// We convert the binary payload into a base64 string because that seems to be the most commonly supported
// format for Azure Functions language workers. Attempts to send unencoded byte[] payloads were unsuccessful.
string encodedRequest = ProtobufUtils.Base64Encode(entityBatchRequest);
Copy link
Contributor

Choose a reason for hiding this comment

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

one of the reasons we used proto encoding for orchestrations is that the OrchestrationRuntimeState wasn't serializable itself, and this was a quick way to reach serialization. If the built in DT.Core EntityBatchRequest and EntityBatchResult types are serializable, we can stick with those if you prefer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is indeed serializable. But I don't have much reason to replace the protobuf serialization as done right now with a different one.

@sebastianburckhardt sebastianburckhardt merged commit d1d6074 into feature/core-entities Sep 11, 2023
sebastianburckhardt added a commit that referenced this pull request Oct 19, 2023
* udpate readme.

* update durability provider class for new core-entities support. (#2570)

* update durability provider class for new core-entities support.

* add configuration setting for max entity concurrency to DurableTaskOptions

* minor fixes.

* update DurableClient to take advantage of native entity queries (#2571)

* update DurableClient to take advantage of native entity queries if available

* fix minor errors.

* address PR feedback

* implement passthrough middleware for entities (#2572)

* implement passthrough middleware for entities.

* propagate changes to protocol

* update/simplify protobuf format

* address PR feedback

* implement entity queries for grpc listener (#2573)

* implement entity queries for grpc listener

* propagate changes to protocol

* update/simplify protobuf format

* Various fixes (#2585)

* durability provider must implement and pass-through IEntityOrchestrationService since it wraps the orchestration service

* simple mistake

* fix misunderstanding of initializer syntax (produced null, not empty list)

* fix missing failure details

* fix missing compile-time switch for trigger value type

* fix missing optional arguments

* fix  missing override

* simplify how entities are excluded from instance queries (#2586)

* add an entity example to the DotNetIsolated smoke test project. (#2584)

* add an entity example to the DotNetIsolated smoke test project.

* remove superfluous argument.

* address PR feedback

* Entities: Add worker side entity trigger and logic (#2576)

* Add worker side entity trigger and logic

* update comments

* Address PR comments

* another small fix that got lost somewhere. (#2596)

* Update packages and version for entities preview (#2599)

* Switch to Microsoft.DurableTask.Grpc (#2605)

* Fix grpc core (#2616)

* pass entity parameters for task orchestration. (#2611)

* Core entities/various fixes and updates (#2619)

* assign the necessary AzureStorageOrchestrationServiceSettings

* propagate changes to query name and metadata parameters

* add missing override for TaskOrchestrationEntityFeature

* Update to entities preview 2 (#2620)

* Add callback handler for entity dispatching (#2624)

* Core entities/propagate changes (#2625)

* add configuration for EnableEntitySupport

* rename includeStateless to includeTransient

* Rev dependencies to entities-preview.2 (#2627)

* Call EnsureLegalAccess from EntityFeature in dotnet-isolated  (#2633)

* create a better error message in situations where client entity functions are called on a backend that does not support entities (#2630)

* Rev package versions, update release notes (#2638)

* Address smoke test build issue (#2647)

* fix translation of legacy query to new entity query support (#2648)

* fix translation of legacy query to new entity query support

* comment out CleanEntityStorage_Many

* try to enable CI on feature branch

* Revert "comment out CleanEntityStorage_Many"

This reverts commit aeaa4b8.

* update to preview.2 packages

---------

Co-authored-by: Varshitha Bachu <vabachu@microsoft.com>
Co-authored-by: Jacob Viau <javia@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-entities required for entity support in isolated P1 Priority 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants