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

Issue with OrchestrationMetadata 'SerializedOutput' for large messages #3010

Open
ghost opened this issue Jan 14, 2025 · 3 comments
Open

Issue with OrchestrationMetadata 'SerializedOutput' for large messages #3010

ghost opened this issue Jan 14, 2025 · 3 comments
Labels
Needs: Attention 👋 .NET Pull requests that update .net code

Comments

@ghost
Copy link

ghost commented Jan 14, 2025

Description

In our .Net 8 Durable Functions app, we sometimes have large Orchestration output. This was working ok in Microsoft.Azure.Functions.Worker.Extensions.DurableTask 1.1.7, but after updating to 1.2.x, the app crashes with a JSON deserialization error when invoking OrchestrationMetadata.ReadOutputAs<>().

After debugging we discovered that the 'SerializedOutput' property value contains the large message blob URL instead of the actual JSON data - example: http://127.0.0.1:10000/devstoreaccount1/hub-largemessages/FetchJob@y8m81oulAKVO7pwg80XQwUNyNM/history-0000000000000006-ExecutionCompleted-5FE4514C-Result.json.gz

Expected behavior

Expectation is that the 'SerializedOutput' contains the output JSON and not the blob reference URL

Actual behavior

'SerializedOutput' contains a URL pointing to the large message blob

Relevant source code snippets

jobResult = metadata.ReadOutputAs<JsonElementWrapper>();

Known workarounds

Rollback Microsoft.Azure.Functions.Worker.Extensions.DurableTask to version 1.1.7

App Details

  • Durable Functions Worker extension version v2.0:
  • Azure Functions runtime version 2.0:
  • C# - .NET 8:
@cgillum
Copy link
Member

cgillum commented Jan 15, 2025

The behavior you're seeing is normally controlled by the fetchLargeMessageDataEnabled setting in host.json (though it looks like it's not currently documented).

{
  "extensions": {
    "durableTask": {
      "hubName": "MyTaskHub",
      "storageProvider": {
        "fetchLargeMessageDataEnabled": true,
      }
    }
  }
}

The default value should be true. By chance are you overriding this value in your settings?

As far as how/whether it's related to just the version change, it doesn't look like this default has ever changed. The other possibility is that there is some regression in the DurableTask.AzureStorage dependency that the extension internally uses that's causing a change in behavior.

Adding @bachuv and @nytian in case they may have ideas about this.

@cgillum cgillum added Needs: Author Feedback Waiting for the author of the issue to respond to a question .NET Pull requests that update .net code and removed Needs: Triage 🔍 labels Jan 15, 2025
@ghost
Copy link
Author

ghost commented Jan 15, 2025

Thanks for the feedback. No, we aren't changing that configuration value - this is our current host.json:

{
  "version": "2.0",
  "functionTimeout": "00:30:00",
  "logging": {
    "logLevel": {
      "Host.Triggers": "Warning",
      "Host.Function.Console": "Warning",
      "Function": "Warning"
    },
    "applicationInsights": {      
      "samplingSettings": {
        "isEnabled": false
      }
    }
  },
  "extensions": {
    "durableTask": {
      "hubName": "%TaskHubName%",
      "storageProvider": {
        "maxQueuePollingInterval": "00:00:01",
        "partitionCount": 12
      }
    },
    "http": {
      "maxOutstandingRequests": 500,
      "maxConcurrentRequests": 200
    }
  }
}

We could try explicitly setting it to "true", although if that's already the default I'm guessing it won't make a difference?

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed Needs: Author Feedback Waiting for the author of the issue to respond to a question labels Jan 15, 2025
@ghost
Copy link
Author

ghost commented Jan 23, 2025

We tried explicitly adding that flag to host.json but saw the exact same error as expected.

      "storageProvider": {
        "maxQueuePollingInterval": "00:00:01",
        "partitionCount": 12,
        "fetchLargeMessageDataEnabled": true
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention 👋 .NET Pull requests that update .net code
Projects
None yet
Development

No branches or pull requests

1 participant