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

How to reach DURATION_OUT_OF_RANGE for /sessions/<sessionId>/extend? #377

Closed
maxl2287 opened this issue Nov 22, 2024 · 4 comments · Fixed by #382
Closed

How to reach DURATION_OUT_OF_RANGE for /sessions/<sessionId>/extend? #377

maxl2287 opened this issue Nov 22, 2024 · 4 comments · Fixed by #382

Comments

@maxl2287
Copy link
Collaborator

Describe the bug

Extend the overall session duration of an active QoS session (with qosStatus = AVAILABLE).
The overall duration of the QoS session, including the additional extended duration, shall not exceed the maximum duration limit fixed for the QoS Profile. If the current duration plus the value of requestedAdditionalDuration exceeds the maximum limit, the new overall duration shall be capped to the maximum value allowed.
An example: For a QoS profile limited to a maxDuration of 50,000 seconds, a QoD session was originally created with duration 30,000 seconds. Before the session expires, the developer requests to extend the session by another 30,000 seconds:
- Previous duration: 30,000 seconds
- Requested additional duration: 30,000 seconds
- New overall session duration: 50,000 seconds (the maximum allowed)
https://github.com/camaraproject/QualityOnDemand/blob/main/code/API_definitions/quality-on-demand.yaml#L339-L344

Let's take this example here.
So after the extension, the overall session duration was set to 50.000 / the maximum of the QoS-profile.
What would happen, if now the user requests for another extension of 30.000 seconds, right after the previous extension?

a) The overall session will again be set to 50.000
b) The provider will answer with a HTTP - 400 and QUALITY_ON_DEMAND.DURATION_OUT_OF_RANGE (see https://github.com/camaraproject/QualityOnDemand/blob/main/code/API_definitions/quality-on-demand.yaml#L1053-L1058)
or c) The provider just allows extension until the maximum is reached, afterwards the session cannot be extended anymore.

If a) is the right answer, and you can extend as much as you want, then I guess QUALITY_ON_DEMAND.DURATION_OUT_OF_RANGE is just a valid error for first-time creation of a session. So not anymore for the extension.

Wdyt?

@maxl2287
Copy link
Collaborator Author

maxl2287 commented Nov 22, 2024

Or maybe I understood it in a wrong way.
When a QoS-Profile has a maxduration of 50.000.
Then a session can maximum live from startedAt + 50.000
There is no extension possible.

Correct me if I am wrong.

@jlurien
Copy link
Collaborator

jlurien commented Nov 27, 2024

Hi Max, to me that error 400 QUALITY_ON_DEMAND.DURATION_OUT_OF_RANGE makes only sense while validating the input value for duration in createSession, and (maybe) requestedAdditionalDuration in extendQosSessionDuration, if the provided value exceeds the maxDuration for the requested QoS profile according to the QoS Profiles API.

In the case of extendQosSessionDuration, it may not be necessary if we allow any value as long as the extended duration does not exceed the maxDuration.

In the case of your question:

Let's take this example here.
So after the extension, the overall session duration was set to 50.000 / the maximum of the QoS-profile.
What would happen, if now the user requests for another extension of 30.000 seconds, right after the previous extension?

In that case the session duration would still be 50.000
My doubt is that in case of requestedAdditionalDuration=100.000, the 400 QUALITY_ON_DEMAND.DURATION_OUT_OF_RANGE may be returned, Although we can admit it and remove this error for this operation.

@hdamker
Copy link
Collaborator

hdamker commented Nov 29, 2024

Within today's QoD call we concluded that the following is correct and QUALITY_ON_DEMAND.DURATION_OUT_OF_RANGE should be removed from the operation extendQosSessionDuration:

In that case the session duration would still be 50.000
My doubt is that in case of requestedAdditionalDuration=100.000, the 400 QUALITY_ON_DEMAND.DURATION_OUT_OF_RANGE may be returned, Although we can admit it and remove this error for this operation.

If we go this path, we should already in the patch release add a description that this error message will be removed in the next version. I will create a PR for that.

@hdamker
Copy link
Collaborator

hdamker commented Dec 1, 2024

Created #382 for the patch release which answers the question within this issue
A new issue to be created for the final removal of the error response.

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 a pull request may close this issue.

3 participants