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

Fix get_status_all() to return all the instances. #477

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

mfathi91
Copy link

WARNING: THIS PATCH IS JUST TO HINT ABOUT THE EXISTING ISSUE. IT NEEDS SOME ADDITIONAL WORK FROM THE MAINTAINERS TO BE MERGED.

get_status_all() function is meant to return all the instances of the durable function. However, if there is more than 100 instances, the function will not return all of them.

This is due to the fact that the if more than 100 instances exists, a continuation token is returned in the response header which is called x-ms-continuation-token. Please see:
https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-http-api#response-2

If we set the continuation token in the next request header, we get the next 100 instances. This is essentially what we want to do in this patch: to supply x-ms-continuation-token if it is given from the API.

Please note that in DurableOrchestrationClient, I have used "response.header" while this attribute does not exist in the "response" object. Adding it is beyond my knowledge and requires maintainer's attention.

WARNING: THIS PATCH IS JUST TO HINT ABOUT THE EXISTING ISSUE. IT
NEEDS SOME ADDITIONAL WORK FROM THE MAINTAINERS TO BE MERGED.

get_status_all() function is meant to return all the instances of
the durable function. However, if there is more than 100 instances,
the function will not return all of them.

This is due to the fact that the if more than 100 instances exists,
a continuation token is returned in the response header which is
called x-ms-continuation-token. Please see:
https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-http-api#response-2

If we set the continuation token in the next request header, we get the
next 100 instances. This is essentially what we want to do in this
patch: to supply x-ms-continuation-token if it is given from the API.

Please note that in DurableOrchestrationClient, I have used "response.header"
while this attribute does not exist in the "response" object. Adding it
is beyond my knowledge and requires maintainer's attention.
@mfathi91
Copy link
Author

@microsoft-github-policy-service agree company="TomTom"

@nytian
Copy link
Contributor

nytian commented Nov 5, 2024

hey @mfathi91, thanks for your contribution! Just let you know that I am reviewing the code and we might need a few changes. Let's update the PR together to make it merge :)

@mfathi91
Copy link
Author

mfathi91 commented Nov 7, 2024

hey @mfathi91, thanks for your contribution! Just let you know that I am reviewing the code and we might need a few changes. Let's update the PR together to make it merge :)

That's great. Thanks @nytian !

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

Successfully merging this pull request may close these issues.

4 participants