Description
Describe the bug
I have two durable function runtimes running locally on different ports. I try to make a durable http call with yield context.df.callHttp
.
Regarding to the docs, the orchestrator function should poll based on the return as long as 202 and a location header is returned.
In my case, callhttp does no polling at all and returns the plain result of the request containing status code 202 and a location header:
[2021-08-29T20:17:24.596Z] {
[2021-08-29T20:17:24.597Z] statusCode: 202,
[2021-08-29T20:17:24.597Z] headers: {
[2021-08-29T20:17:24.598Z] Date: 'Sun, 29 Aug 2021 20:17:24 GMT',
[2021-08-29T20:17:24.598Z] Server: 'Kestrel',
[2021-08-29T20:17:24.599Z] 'Transfer-Encoding': 'chunked',
[2021-08-29T20:17:24.599Z] Executed 'Functions.UpdateFunction' (Succeeded, Id=85f4cbae-34da-4ae8-9f27-469041954a81, Duration=6ms)
[2021-08-29T20:17:24.599Z] Location: 'http://localhost:7072/runtime/webhooks/durabletask/instances/53fccd02ea564e088b5b03c06520aaf3?taskHub=kametlicensingapihub&connection=DfStorageConnectionString&code=jD7lnp5vqS34wvyYTmSKUpKCWxZy5BXmuCLMPAYCsqGXgAYNUvdhDQ==',
[2021-08-29T20:17:24.600Z] 'Retry-After': '10'
[2021-08-29T20:17:24.601Z] },
[2021-08-29T20:17:24.601Z] content: '{\r\n' +
[2021-08-29T20:17:24.602Z] ' "id": "53fccd02ea564e088b5b03c06520aaf3",\r\n' +
[2021-08-29T20:17:24.603Z] ' "statusQueryGetUri": "http://localhost:7072/runtime/webhooks/durabletask/instances/53fccd02ea564e088b5b03c06520aaf3?taskHub=kametlicensingapihub&connection=DfStorageConnectionString&code=jD7lnp5vqS34wvyYTmSKUpKCWxZy5BXmuCLMPAYCsqGXgAYNUvdhDQ==",\r\n' +
[2021-08-29T20:17:24.603Z] ' "sendEventPostUri": "http://localhost:7072/runtime/webhooks/durabletask/instances/53fccd02ea564e088b5b03c06520aaf3/raiseEvent/{eventName}?taskHub=kametlicensingapihub&connection=DfStorageConnectionString&code=jD7lnp5vqS34wvyYTmSKUpKCWxZy5BXmuCLMPAYCsqGXgAYNUvdhDQ==",\r\n' +
[2021-08-29T20:17:24.604Z] ' "terminatePostUri": "http://localhost:7072/runtime/webhooks/durabletask/instances/53fccd02ea564e088b5b03c06520aaf3/terminate?reason={text}&taskHub=kametlicensingapihub&connection=DfStorageConnectionString&code=jD7lnp5vqS34wvyYTmSKUpKCWxZy5BXmuCLMPAYCsqGXgAYNUvdhDQ==",\r\n' +
[2021-08-29T20:17:24.604Z] ' "rewindPostUri": "http://localhost:7072/runtime/webhooks/durabletask/instances/53fccd02ea564e088b5b03c06520aaf3/rewind?reason={text}&taskHub=kametlicensingapihub&connection=DfStorageConnectionString&code=jD7lnp5vqS34wvyYTmSKUpKCWxZy5BXmuCLMPAYCsqGXgAYNUvdhDQ==",\r\n' +
[2021-08-29T20:17:24.605Z] ' "purgeHistoryDeleteUri": "http://localhost:7072/runtime/webhooks/durabletask/instances/53fccd02ea564e088b5b03c06520aaf3?taskHub=kametlicensingapihub&connection=DfStorageConnectionString&code=jD7lnp5vqS34wvyYTmSKUpKCWxZy5BXmuCLMPAYCsqGXgAYNUvdhDQ==",\r\n' +
[2021-08-29T20:17:24.605Z] ' "restartPostUri": "http://localhost:7072/runtime/webhooks/durabletask/instances/53fccd02ea564e088b5b03c06520aaf3/restart?taskHub=kametlicensingapihub&connection=DfStorageConnectionString&code=jD7lnp5vqS34wvyYTmSKUpKCWxZy5BXmuCLMPAYCsqGXgAYNUvdhDQ=="\r\n' +
[2021-08-29T20:17:24.606Z] '}'
[2021-08-29T20:17:24.607Z] }
I tried calling it with POST and with GET, which made no difference at all:
const result = yield context.df.callHttp(
"POST",
`http://localhost:7072/api/OtherFunctionOrchestrator`,
{ a, b, c}
);
const result = yield context.df.callHttp(
"GET",
`http://localhost:7072/api/OtherFunctionOrchestrator?parametera=${a}¶meterb=${b}¶meterc=${c}`
);
Investigative information
- Durable Functions extension version: ExtensionBundle "[2.*, 3.0.0)"
- durable-functions npm module version: 1.5.2
- Language (JavaScript/TypeScript) and version: TypeScript 4.4.2
- Node.js version: 14.17.4
Expected behavior
callHttp should poll the endpoint until the return code is 200 and then return the actual result.
Actual behavior
callHttp does one single call, does no polling despite the location header and status 202 being present and returns the first reply package containing the statusUris.
I am using Windows 10 19043.